Skip to content

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

Open
jorge-leon wants to merge 2 commits intohughbarney:masterfrom
jorge-leon:suspend
Open

Add C-z command to suspend the editor to the calling shell#16
jorge-leon wants to merge 2 commits intohughbarney:masterfrom
jorge-leon:suspend

Conversation

@jorge-leon
Copy link
Copy Markdown

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)

@frou
Copy link
Copy Markdown

frou commented Sep 7, 2022

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!

through a friendly note from Duncan Holm and almost literally copied from him:

frou/femto@63a3134
@jorge-leon
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants