dosemu2 / comcom64

64bit command.com
https://github.com/dosemu2/comcom32/
GNU General Public License v3.0
32 stars 5 forks source link

"system" and "unix" commands don't work when I shell to DOS from WordPerfect #39

Closed emendelson closed 4 years ago

emendelson commented 4 years ago

Describe the bug For the old dosemu, I wrote WordPerfect macros that shelled to DOS and ran the system command to run a shell script. Under dosemu2, the system command works perfectly from the dosemu2 prompt, but it produces "bad command or filename" when I shell to DOS from WP.

To Reproduce Steps to reproduce the behaviour: Run WPDOS, Ctrl-F1, Go to DOS, enter "system" or "unix".

I don't know if this is related to the (fixed) problem with shelling to DOS from WP. I don't have another DOS app to test that shells to DOS. If I run command from the dosemu2 prompt, the commands work correctly, but not when I shell to DOS from WP.

andrewbird commented 4 years ago

What do you see if you do 'Go to DOS' and enter the command set?

stsp commented 4 years ago

He see this:

Type 'EXIT' to return to program
C:\WP62>set
USERDRV=C
SHELLDRV=L
DOSEMUDRV=J
FDPP_AUTOEXEC=J:\FDPPAUTO.BAT
FREEDOSDRV=M
COMSPEC=L:\COMMAND.COM
BLASTER=A220 I5 D1 H5 P330 T6
MIDI=SYNTH:2 MAP:E MODE:0
DOSEMU_VERSION=2.0pre8-20200520-1862-ge6e2ff036
PROMPT=Type 'EXIT' to return to program$_$P$G
Type 'EXIT' to return to program
andrewbird commented 4 years ago

no PATH?

emendelson commented 4 years ago

No PATH. When I enter the path manually, the commands work correctly.

stsp commented 4 years ago

I guess WP just removes his own env segment and puts parent's to PSP. As the result, no variables that command.com set, are here. Oh well, I can also force the propagation of PATH, in addition to comspec...

emendelson commented 4 years ago

Thank you! My goal to have everything available for WP under Linux that I've set up for DOSBox-X and vDos. (And by the way, the system command is a great help. I had to use my almost zero knowledge of C++ to write an equivalent command that I could patch into DOSBox-X.)

stsp commented 4 years ago

Should now be fixed.

emendelson commented 4 years ago

Yes, fixed. Thank you!

jschwartzenberg commented 4 years ago

I'm curious what kind of WP macros you have that use unix and system. Could you provide some info on what they do? Did you consider putting them in a Git repo? :)

emendelson commented 4 years ago

I'm curious what kind of WP macros you have that use unix and system. Could you provide some info on what they do? Did you consider putting them in a Git repo? :)

My macros use "unix" (not system, but I tested system anyway). A LINCOPY macro copies the selected text in WPDOS to the Linux clipboard. A LINPASTE macro pastes the contents of the Linux clipboard into the current document. They're a complete mess because I simply took my old Windows macros and modified them to fit. I'm now trying to rewrite them to work with dosemu2.

You can find the old versions (which worked with the old dosemu) here:

http://www.columbia.edu/~em36/wpdos/linux.html#pastemacro

But they need to be changed to work in dosemu2. I have the 5.1 LINCOPY working, but the 5.1 LINPASTE has problems. I haven't started on the WPDOS 6.x versions.