atto
atto copied to clipboard
Add C-z command to suspend the editor to the calling shell
This is a useful feature, especially when working on a remote machine.
I am absolutely unsure about the
noraw(); endwin();
and the raw(); noecho(); idlok(stdscr, TRUE);
sequences, they are just guesses taken from main.c
, but they seem to do their job.
Wheelers SLOC: 1622 (vs. 1610) Line count: 1984 (vs. 1970)
I added a similar feature to my fork of femto
and was pleasantly surprised that it could be done with nothing more than sending SIGTSTP
to self. I don't know if it's a better way to implement this feature than explicitly calling ncurses stuff, but it Works On My Machine!
I added a similar feature to my fork of
femto
and was pleasantly surprised that it could be done with nothing more than sendingSIGTSTP
to self. I don't know if it's a better way to implement this feature than explicitly calling ncurses stuff, but it Works On My Machine!
Thanks @frou: atto is now under 2000 lines again (1999 :)
See https://en.wikipedia.org/wiki/Job_control_%28Unix%29#Implementation, the part on Ctrl-Z. I guess, ncurses just catches SIGTSTP so you can use the key combination at your will. Well: we put SIGTSTP back where it was before.