2

Background

I have the following two lines in ~/.zshrc.

setopt noflowcontrol
ttyctl -f

The first line disables flow control in zsh. I'm unsure what the second does, but I was advised to add it from an introductory article on zsh.

As expected, flow control is disabled in the interactive shell. However, when I open other terminal programs, like vim, mutt or newsbeuter, flow control is back on. That is, pressing Ctrl+s freezes the terminal.

More information

I've tried setting the following in the terminal too, but none seem to help.

stty stop undef
stty start undef
stty -ixon
stty -ixoff

Oddly enough, if I run the following in a single line, then flow control is disabled.

stty -ixon; vim

However, if I split it into two separate lines, then flow control is back on. The setting doesn't seem to "stick". This workaround doesn't work for setopt noflowcontrol; vim.

When I remove the line ttyctl -f, then flow control is disabled in vim and mutt, etc. as expected.

Questions

  1. What does ttyctl -f do, and what are the ramifications of disabling it?
  2. Why does it interfere with flow control?
  • Running xterm -e zsh -f and starting vim from the shell has flow control on. If I run stty -ixon at the zsh prompt first, or if I put this in my .zshrc, then flow control is off in vim. This is on a pristine Debian stable (zsh 5.0.7) — and also on every system I remember using (I have stty -ixon) in my .zshrc` and in my .bashrc. What could be different in your setup? Do you have the same problem with a fresh account with no configuration files? What distribution(s) are you running? – Gilles Jan 15 '17 at 20:48
  • Ah, thanks @Gilles. I forgot about zsh -f. This indeed fixes it for me in Arch and Debian (Raspbian). I tracked it down to the following line in ~/.zshrc: ttyctl -f, which I think I put in there on the advice of… someone on the internets. I still don't entirely know why it was there and what the ramifications are of removing it. If you could please write up a short answer, I'd be happy to accept. Thank you again. – Sparhawk Jan 16 '17 at 14:15
  • I don't know what ttyctl is. Your question is unanswerable in its present state since what you posted does work. Either edit it to ask why ttyctl -f causes this problem, or delete it. – Gilles Jan 16 '17 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.