Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blocked background processes from printing to terminal #45

Closed
aelmahmoudy opened this issue May 9, 2020 · 0 comments
Closed

blocked background processes from printing to terminal #45

aelmahmoudy opened this issue May 9, 2020 · 0 comments

Comments

@aelmahmoudy
Copy link
Contributor

aelmahmoudy commented May 9, 2020

elinks(1) has a wried hehavior that blocks the controlling terminal from
being written by other background processes, while this may be intended to
maintain the readability the ELinks TUI, it usually causing problems due to
processes that trying to write to the terminal will be suspended by SIGTTOU;
to make the problem worse, user can't notice this immediately until exiting
elinks(1); after that the shell would indicates one or more background
processes being suspend, like '[1]+ Stopped ...' reported by bash(1).

It is very annoying for me because sometimes I would need to start a program
like ssh(1), to setup some port forwardings for use within elinks(1), in the
background, for example 'ssh ... -L 8000:... -N &'; it works on beginning,
but sometimes the background process may want to report a networking issue,
by printing an error message to stderr, then it being suspended, and the web
server forwarded by the background process becomes unresponsive, ELinks
stucks on 'Making connection' status until finally timed out... This
situation can only be recovered by exiting elinks(1), 'bg' that suspended
process and start elinks(1) again.

A Debian user suggested the following patch:

--- src/terminal/kbd.c.orig     2019-01-26 09:48:21.000000000 +0800
+++ src/terminal/kbd.c  2020-04-22 16:29:45.009109375 +0800
@@ -260,9 +260,6 @@
 
        elinks_cfmakeraw(&t);
        t.c_lflag |= ISIG;
-#ifdef TOSTOP
-       t.c_lflag |= TOSTOP;
-#endif
        t.c_oflag |= OPOST;
        if (tcsetattr(itrm->in.ctl, TCSANOW, &t)) return -1;
@rkd77 rkd77 closed this as completed in a3e84e2 May 10, 2020
rkd77 added a commit that referenced this issue May 13, 2020
rkd77 added a commit that referenced this issue May 13, 2020
ui.tostop decides whether to stop background processes trying to write
to the terminal. Default enabled.
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

No branches or pull requests

1 participant