Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Martin Vieregg

Pages: 1 ... 3 4 [5] 6 7 ... 19
61
Programming / Table of similar API calls for OS/2 and Windows ?
« on: July 11, 2020, 11:13:01 pm »
Does a tutorial or list of corresponding API calls for OS/2 and Windows, like DosCreateNPipe (OS/2) and CreateNamedPipe (Windows) exist somewhere?

62
I have updated MeShell to 0.71. Not tried it yet, but with 4os2 now the command length limit should be 2048 characters.
Here you can download MeShell 0.71 (700 kB)

63
You can write a cmd file. The limit of a single commands in a cmd file seems to be 1023 characters.

The limit when typing a command in cmd.exe is 259 characters. It seems to be syntax specific. A longer input shows an error message:

SYS1065: The input line is too long.

In MeShell, there is a limit of 255 characters because of a bug. It will be fixed in the next version 0.71. Then the combination of MeShell and 4os2 will work with longer lines. Together with cmd.exe, you will have a limit of 259 characters again.

64
Utilities / Re: MeShell commandline frontend timetable
« on: July 09, 2020, 03:28:04 pm »
MeShell 0.70 with syntax completion (command completion and file name parameter completion) is finished.

Here you can download MeShell 0.70 (700 kB)

You will find a new chapter "Syntax completion" in the docu.

The functionality is more extensive than in 4os2 or in Windows. There are also useful hint windows with different colors. You can turn on and off every feature on the "Complete" page of the settings notebook. The settings are also explained in the docu, page Settings Notebook - Complete.

There are also again other bugs fixed.

65
Programming / Re: MeShell problem - start progname inherits stdin/out
« on: July 03, 2020, 11:36:22 pm »
I have chosen now renaming the pipe if the old pipe is still occupied. It was quite complicated, because I already need to count the pipes for several instances of MeShell. I could choose this option because I have the luck that when starting a PM app from cmd.exe, the inpipe is not inherited (because a PM program cannot read keyboard input from an inpipe, but it could create stdout and stderr output). The instances are counted Pipe1, ...Pipe2, Pipe3 for the inpipe and the first free pipe is the instance number which influences colors and default directories. The stdout and stderr pipes ends with A1, A2... If PipeA1 fails for stdout and stderr because it is still occupied from the started PM program, PipeB1 is tried and so on.
It works fine already. So now I have no restrictions at all when starting a PM application and it gets the current directory by default.

66
Programming / Re: MeShell problem - start progname inherits stdin/out
« on: July 01, 2020, 02:46:55 pm »
Yes, it is an option. But it gets more difficult if there are several parameters. I can compare all parameters with the filenames in the current directory and automatically expand the filenames.

Another option would be to start the app directly from the editor and to send a remark to cmd.exe:

rem e textfile.txt (started via MeShell)

Then, renaming the pipe when failing is still an option. I realized now: Because cmd.exe stdin does not fail (only stdout and sterr is inherited), it will be possible to find out whether the pipe is occupied by a started and still running app or by another MeShell instance.

So I have three options to solve the problem.

67
Programming / Re: MeShell problem - start progname inherits stdin/out
« on: July 01, 2020, 12:13:12 pm »
Thank you Laurence!

start /I e indeed works fine.

I have implemented a function where MeShell compiles the string before sending it to cmd.exe. When starting an application, MeShell calls DosQueryAppType and if it is a PM program, it changes the call string to
[C:\] start /I mypmprog

But now, the started PM program does not inherited the current directory of cmd.exe anymore. I haven't found a parameter how to enter the current directory. So a call like

START /I e textfile.txt

fails because textfile.txt resides in the current directory an not in C:\. Any idea?



68
Programming / Re: MeShell problem - start progname inherits stdin/out
« on: July 01, 2020, 08:06:29 am »
"start e" is not accepted because it it read as a whole word. start "e" makes no difference to start e. I haven't found something about redirection.

I fear that I have to change the pipe name of the new pipe if the default pipe name is occupied, but it won't be a good solution because the internal instance counter (who influences the colors) when running several instances of MeShell has to be increased. MeShell increases the instance number when opening the named pipe fails which contains the instance counter in the filename.

69
Programming / MeShell problem - start progname inherits stdin/out
« on: June 30, 2020, 10:40:14 pm »
I have realized now why sometimes starting MeShell fails ("cannot create inpipe...") because a named pipe which has to be closed when closing the last instance of MeShell seems to be still occupied.

The problem occurs if a program has been started via start from MeShell:

[C:\] start e

starts the e Editor in an own session. But it seems that this new session inherits stdout and stdin from the calling cmd.exe process, even it is a PM program, and stdout and stdin are redirected named pipes which are generated when starting MeShell. So when leaving MeShell, the pipes are still occupied while the e Editor is running and MeShell cannot be restarted. After closing the e Editor, you can restart again MeShell. Any idea how to omit inheriting stdin/out/err when starting a program in an own session via Cmd.exe?

70
Thank you for the useful hints. @ is not a good idea. Now I realized that "start" and "call" are opposing pairs. So I will add a user setting
[ ] run PM apps asynchronously (via "start")

I assume that PM programs who start asynchronously accept using "start" in front of the program name. IBMview does.
If a user wants to start a PM program synchronously, he has to explicit use "call" in front of the program name if the setting is activated. I will note this in the docu.

In the Windows command line, this is default behaviour.

If a PM program is executed via CMD file, then the setting has no effect, because MeShell does not interpretate the content of the cmd file.

71
What about a leading special character like @ to omit the "start" functionatliy with a separate session? cmd.exe seems to ignore a leading @. Or does it have another meaning?

For example writing a cmd file where a text file is generated, then an editor is started to edit the textfile and then the batch file continues after saving the file and leaving the editor, indeed a possibility to turn off this functionality will be necessary.

72
OK. Then "window-compatible" is the only case where I do not need the START command, because fullscreen needs an own session.

Is there a case where this automatic behaviour should be omitted? (Is a user setting for this option necessary?)

73
Thank you for your answers. DosQueryAppType should fit my purpose. This API call refers to the bits Dave mentioned. I assume that the following bits are interesting for me:

001 -     (FAPPTYP_NOTWINDOWCOMPAT, 0x00000001): Application type is not-window-compatible.
010 -     (FAPPTYP_WINDOWCOMPAT, 0x00000002): Application type is window-compatible.
011 -     (FAPPTYP_WINDOWAPI, 0x00000003): Application type is window-API


So it seems that 0x1 means the program runs in the cmd.exe session.

Bit 5     (FAPPTYP_DOS, 0x00000020): Set to 1 if the executable file is in PC/DOS format. Bits 0, 1, 2, 3, and 4 will be set to 0.


DOS programs have to run in their own session, of course. So I think simply checking bit 0x1 set and 0x2 unchecked should be sufficient.

I will report here after testing different sample programs. I am not clear what "window-compatible" means.

74
I have written a syntax completion of commands for the next MeShell version. For this purpose, I have saved the PATH list exe, com, bat and cmd files in a very fast string list. I want to use this for another purpose:

In my opinion, it is nervy to write "start" in front of the name of the PM program which is not running in the same session as cmd.exe. Otherwise MeShell switches to non prompt state (LED glows red). I want to send a "start progname" to cmd.exe instead of "progname". I need a secure way to binary analyze the EXE file and to see if it is a PM program or a cmd program (generating stdout or VIO and running in a command window). Any ideas what part of the binary I have to check? Or is there an API call doing this?

75
Utilities / Re: MeShell commandline frontend timetable
« on: June 21, 2020, 11:53:47 pm »
I am in contact with Andreas Buchinger and I think that he will implement the needed things  the next weeks. He already sent me a version where he changed already something to test it. According to current knowledge, it is only two minor things:
- when pressing Ctrl-C, "^C" has to be sent to stdout, not to VIO
- when redirecting 4os2 output to a file (or a pipe), some things (colors, line endings) are changed and filtered. We simply need a setting (commandline parameter or 4os2.ini file) where the changes are omitted in this case.

Then I have reported a bug that when redirecting output to a file and the output contains lines ending with ^M without ^J (Return without carriage)  to overwrite the old line (like in a progress text 5% done, 10% done...) the wrong lines are filtered: The lines which are overprinted are shown in the text file and the final ines which should stay are omitted.

If anyone has found other problems with 4os2 and MeShell, please report here. I myself do not use it regulary.

Meanwhile, I began to program syntax completion. It is not very difficult to program. I will also implement program name completion based on the cmd.exe  internal commands and the PATH list. The dropdown flyover list is already programmed in my german accounting program "Textbuch". I will implmenent several user settings (flyover no/when pressing TAB,  automatically after ...quarterseconds), so anyone should get happy.

Pages: 1 ... 3 4 [5] 6 7 ... 19