diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-03-22 19:53:22 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-03-22 19:53:22 +0100 |
| commit | fc0efcc89825ef1f61ffe5744b58f7d4e16c2aae (patch) | |
| tree | 607fa0c0469e026e220c25a646cd0ec649eb7916 /ui-terminal.c | |
| parent | c9a259bbe118d60558a8891e0bd701e8fb0ba91d (diff) | |
| download | vis-fc0efcc89825ef1f61ffe5744b58f7d4e16c2aae.tar.gz vis-fc0efcc89825ef1f61ffe5744b58f7d4e16c2aae.tar.xz | |
ui: try to fix job control issues with certain shells
Make sure that curses and libtermkey don't fight over
the terminal state. Also send use SIGTSTP instead of
SIGSTOP.
Previously certain shells (e.g. csh, dash) would get
stuck after the editor process was suspended for the
second time.
Not completely sure whether this is correct, but it
seems to work in my limited tests.
Diffstat (limited to 'ui-terminal.c')
| -rw-r--r-- | ui-terminal.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ui-terminal.c b/ui-terminal.c index 4b4a60b..e790785 100644 --- a/ui-terminal.c +++ b/ui-terminal.c @@ -563,7 +563,7 @@ static void ui_info_hide(Ui *ui) { } static TermKey *ui_termkey_new(int fd) { - TermKey *termkey = termkey_new(fd, TERMKEY_FLAG_UTF8); + TermKey *termkey = termkey_new(fd, UI_TERMKEY_FLAGS); if (termkey) termkey_set_canonflags(termkey, TERMKEY_CANON_DELBS); return termkey; @@ -589,13 +589,11 @@ static TermKey *ui_termkey_get(Ui *ui) { static void ui_suspend(Ui *ui) { UiTerm *tui = (UiTerm*)ui; ui_term_backend_suspend(tui); - termkey_stop(tui->termkey); - kill(0, SIGSTOP); + kill(0, SIGTSTP); } static void ui_resume(Ui *ui) { UiTerm *tui = (UiTerm*)ui; - termkey_start(tui->termkey); ui_term_backend_resume(tui); } @@ -650,7 +648,7 @@ static bool ui_init(Ui *ui, Vis *vis) { if (errno == EBADF && !isatty(STDIN_FILENO)) { errno = 0; if (!(tui->termkey = ui_termkey_reopen(ui, STDIN_FILENO)) && errno == ENXIO) - tui->termkey = termkey_new_abstract(term, TERMKEY_FLAG_UTF8); + tui->termkey = termkey_new_abstract(term, UI_TERMKEY_FLAGS); } if (!tui->termkey) goto err; |
