Skip to content

Preserve the tty modes between commands. - #2317

Closed
mwm wants to merge 1 commit into
fish-shell:masterfrom
mwm:stty-preserving
Closed

mwm wants to merge 1 commit into
fish-shell:masterfrom
mwm:stty-preserving

Conversation

@mwm

@mwm mwm commented Aug 18, 2015

Copy link
Copy Markdown
Contributor

This removes the default disabling of flow control, and then copies the tty modes to the terminal_mode_for_exucuting_programs after a command exits. This copies the behavior of other shells, and thus behaves as most people expect terminal modes to.

This is a fix for issue #2315. I could not reproduce issue #814 locally no matter what I set ixon to.

@zanchey zanchey added this to the fish-future milestone Sep 11, 2015
@zanchey

zanchey commented Sep 11, 2015

Copy link
Copy Markdown
Member

I have seen C-s trip up so many novice users that I am nervous about re-enabling it; surely a pager is the right solution to the too much output problem?

I wonder if - instead of resetting the entire terminal mode - fish should just send the exit_alt_charset_mode character as that's the main thing that printing random binary data to the terminal screws up.

@mwm

mwm commented Sep 11, 2015

Copy link
Copy Markdown
Contributor Author

A pager is only a solution if you're in the shell, know that you're going to need it, and remember to use it when you launch the command. Unless it's in the tty driver, which we can't depend on being in place.

Disabling flow control isn't really the issue, though it should be documented. The issue is that fish won't let the user who wants it re-enable it. Or in any other way change the tty settings that are in effect for other commands. For instance I can't change the erase character. This seems to violate two of the three high-level goals of the design of fish, as it isn't user friendly, limits expressiveness, and can be done in other shells.

We don't need to reset the entire terminal mode, but we do have to turn ICANON and ECHO back on before running a shell, and then back off when the command exits. Doing just that instead of the full reset would fix this issue as well.

Changing the default prompt to switch to the standard character set sounds like a reasonable thing to do, but is independent of this issue. If we also let users change the stty settings, we could add disabling flow control to the default config.fish rather than have fish do it, a solution I much prefer.

Would you like a change that does the flow control handling as discussed here, rather than the current way?

@krader1961

Copy link
Copy Markdown
Contributor

Philosophical discussions about a change really belong in the associated issue and not the code change. If the code change is not compatible with the philosophy of the project that should be documented in the associated issue. Pull requests (i.e., code changes) should be limited to the correctness of the change.

@krader1961

Copy link
Copy Markdown
Contributor

You also need to update reader_init().

@krader1961

Copy link
Copy Markdown
Contributor

Sorry, @mwm, but I'm going to reject this even though I agree in principal that fish should not be unilaterally disabling flow-control. However, that change in behavior was made over two years ago (see issue #814) and it seems most people prefer the current behavior. At this juncture the only sensible thing to do is fix the underlying tty mode handling as I discussed earlier so that the user is in control and can re-enable flow-control if they so desire.

@faho faho removed this from the fish-future milestone May 1, 2016
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants