atto icon indicating copy to clipboard operation
atto copied to clipboard

Add C-z command to suspend the editor to the calling shell

Open jorge-leon opened this issue 2 years ago • 2 comments

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)

jorge-leon avatar Jul 19 '22 11:07 jorge-leon

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!

frou avatar Sep 07 '22 07:09 frou

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!

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.

jorge-leon avatar Sep 07 '22 14:09 jorge-leon