jonmacs / jove

Jonathan's Own Version of Emacs : a venerable (1983?), fast, small Emacs clone that was originally written for 2.8BSD on PDP-11. Some of us have been using and contributing to it since 1986.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sending EOF to master pty in Debian Linux

opened this issue · comments

When I run an inferior shell in Jove, if I use the 'eof-process' command or '^C ^D', then the output on the command line is '^Dexit' and Jove says 'exited, not EOF'd, and I can't kill the shell buffer. Not sure what the issue is here...I read up on pty. Is Jove perhaps using BSD pty? At any rate, Any help would be appreciated.

OK, I just read in the README that the above-described problem is known, and that the fault is to be placed with my operating system. I guess I'll just live with it.

Sorry for the delayed response -- I've been busy with non-Jove activities.

What version of Jove are you running? In the version I'm using (4.17.3.7) on Ubuntu 16.04, an eof-process produces

$ ^D
[Process i-shell: Done]

(4.17.1.x and 2.x included several pty fixes)

I can reproduce it with the newest version, I compile currently with SYSDEFS=-DXLINUX

Is this still the way to go @markmoraes ?
You added something like

#       Linux (modern, UNIX98 PTYS)     SYSDEFS=-DLinux
#       Linux (modern, UNIX98 PTYS)     SYSDEFS=-DLinux TERMCAPLIB=-lncursesw
#       Linux (modern, glibc pty.h)     SYSDEFS=-DGLIBCPTY EXTRALIBS=-lutil

to the README. But running with the latter just complains.

cc: warning: EXTRALIBS=-lutil: linker input file unused because linking not done
cc: error: EXTRALIBS=-lutil: linker input file not found: No such file or directory

Ah. EXTRALIBS shouldn't be needed on most modern Linux AFAICT, that's old advice that I should remove from the README (copied it from the Makefile), but at this point, buildflags.sh contains the most current info, and the good default flags for any Linux (certainly Debian, which I did test in a container, since Ubuntu and Mint are my primary home distros) are:

$ ./buildflags.sh --cflags
-DLinux -Os -Wall -pedantic -D_GNU_SOURCE
$ ./buildflags.sh --libs
-lncurses -ltinfo

You can, of course, switch from -Os -Wall -pedantic to whatever combo of optimization and warnings you prefer to override the Makefile use of buildflags.

Ouch -- works fine for me in debian:9 "[Process i-shell: Done]" docker (hence Ubuntu 16.04) but breaks in debian:10 docker "[Process i-shell: Exited 0; not EOFed]" (and hence Mint 20).

Ok, time to dive into iproc.c again and see if I can understand where/why this goes wrong. The comment in the README suggests that Hugh or I tried to find this before and couldn't, sigh.

@C0RD Seems like

make SYSDEFS='-DGLIBCPTY -Os -Wall -pedantic' EXTRALIBS='-lncurses -lutil'

works fine (consistently produces "[Process i-shell: Done]" for me) on Debian 10 (also avoids the need for pkg-config as a dependency)

Maybe GLIBCPTY is a safer default for modern Linux (better to trust system-supplied openpty rather than the utter hairball of ifdefs that I've had to create for pty support across the decades of OS differences.

try https://github.com/jonmacs/jove/releases/tag/4.17.4.1 which fixes this problem in my tests (if you build with -DLinux and -lutil, or the default buildflags.sh). @C0RD Note that I've left -DXLINUX as the old-style build, so better to stop using that for modern Debian (10 or newer)

I removed the SYSDEFS-Definition, so none is left and it builds fine.
Also the shell issue is gone.

I just uploaded it to Debian unstable. Lets see how it does.

I don't see any relation to the initial bug report.
My checks show that the initial issue is fixed and so I will now close this issue.

I have to admit that i don't fully understand what you are suggesting or reporting, but if you want to have this as a enhancement.-request please open a new issue in our tracker. Thank you.

Feel free to open an issue for enhancement to support the Xah fly keys system, but I'd caution that I have pretty limited and sporadic time to write new code for Jove, so it may sit for a while. I suspect it won't be possible in Jove as-is without some additional code, since Jove does not have a command-mode vs insert-mode distinction (and I'm guessing the other Jove developers will object to adding that approach). It might be possible to create some kind of special mode to associate a keymap with (similar to the process-map) without too much code, but new modes also make me nervous from a test perspective.