joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.65k stars 377 forks source link

Ctrl+C makes a heart symbol #2168

Open ghost opened 3 years ago

ghost commented 3 years ago

I'm using the latest release of dosbox-x. The program I'm using is the GNU ed port to DOS via DJGPP and there is a problem with sending a break signal with Ctrl+C. It makes a heart symbol instead and I can't figure out a way to be able to exit editing mode in GNU ed for DOS. Can I have some help please.

joncampbell123 commented 3 years ago

Does CTRL+C work with anything else?

Perhaps DOSBox-X is unable to send a CTRL+C signal to protected mode applications.

ghost commented 3 years ago

Does CTRL+C work with anything else?

Perhaps DOSBox-X is unable to send a CTRL+C signal to protected mode applications.

I tested it in EDIT and outside of programs at the command line. Nothing happened in EDIT and command line gave me a ^C. You can test out the program yourself because I got it from here: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/ed-1142b.zip Also the source code if you need it: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/ed-1142s.zip

grapeli commented 3 years ago

@JGCYASYS ed.info "An interrupt (typically Control-C) has the effect of aborting the current command and returning the editor to command mode". You leave ed by command: q

or Ctrl-D (sends an EOF to close the terminal). Doesn't work under dos.

ghost commented 3 years ago

@JGCYASYS ed.info "An interrupt (typically ) has the effect of aborting the current command and returning the editor to command mode". You leave ed by command: q

or Ctrl-D (sends an EOF to close the terminal). Doesn't work under dos.

I'm testing GNU ed for DOS right now in a VM for freedos 13 livecd. It works as intended like on linux. I can type "." during edit mode to return to command mode and typing Ctrl+C and then enter (Edit: I was partially wrong. Ctrl + D doesn't return me to command mode while in edit mode in ed under freedos) will return to me command mode. In Dosbox-X I'm stuck in edit mode if I type . or Ctrl+C. I'm convinced now this is a bug because it works just like linux under freedos but not dosbox-x.

grapeli commented 3 years ago

@JGCYASYS ed does not work properly under dosbox-x. Neither command is functioning. a [append] s [substitute] w [write] q [quit]

ctrl-d has no function in ed under freedos. Also under dosemu2.

ThePillenwerfer commented 3 years ago

Ctrl-z is a bit iffy too. If you try copy con test, enter some text and then press Ctrl-z to insert an End of File marker it puts → on screen rather than ^Z. It does however work properly.

Screenshot at 2021-01-08 01-11-08

Wengier commented 3 years ago

@JGCYASYS The issue that Ctrl+C makes a heart symbol in GNU ed is hopefully fixed in #2171.

@ThePillenwerfer You can consider that pressing Ctrl-Z shows → rather than ^Z to be a cosmetic issue. It will eventually be fixed in general (because it does not limit to Ctrl-Z I believe).

grapeli commented 3 years ago

@Wengier It only changed that you can abort malfunctioning ed under DOSBox-X without needing to restart DOS. ed still doesn't work properly under dosbox-x compared to how the same version behaves under FreeDOS.

Ctrl-C does not terminate ed under Linux or FreeDOS.

ed is the progenitor of programs such as sed, vi. If you know how to handle them, you can handle ed.

ghost commented 3 years ago

@JGCYASYS The issue that Ctrl+C makes a heart symbol in GNU ed is hopefully fixed in #2171.

@ThePillenwerfer You can consider that pressing Ctrl-Z shows → rather than ^Z to be a cosmetic issue. It will eventually be fixed in general (because it does not limit to Ctrl-Z I believe).

It's not just Ctrl+C that doesn't work which hopefully gets fixed in the upcoming merge. I mentioned above that using . to quit GNU ed under dosbox-x doesn't quit editing mode to return to command mode like how it does under linux or freedos. That too needs to be fixed among a few other things.

Wengier commented 3 years ago

@grapeli and @JGCYASYS Yes, I believe the DOS read device function is not implemented correctly. As a result, commands like q have no effect as this time.

ghost commented 3 years ago

Thanks for the recent update. CTRL+C works in ed now along with CTRL+Z. However, using "." to exit edit mode still doesn't work and that needs to be fixed as well. Also when I press CTRL+C to quit it says "stdin: No space left on drive (ENOSPC)" What is up with that? Also, "q" doesn't quit if I happen to be in command mode. It goes right into edit mode. I'm using the newest version of dosbox-x, SDL2, and text mode ttf rather than opengl or directx if that helps.