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

Term size issues after ncurses app crash #7133

Closed
mqudsi opened this issue Jun 19, 2020 · 11 comments
Closed

Term size issues after ncurses app crash #7133

mqudsi opened this issue Jun 19, 2020 · 11 comments
Labels
regression Something that used to work, but was broken, especially between releases
Milestone

Comments

@mqudsi
Copy link
Contributor

mqudsi commented Jun 19, 2020

After a full-screen ncurses app (neovim) crashed on a failed assertion, something in the internal term size state (even though I did not physically resize the terminal) broke:

image

As you can see, the columns and rows info is, however, correct.

When an ncurses app breaks the terminal state on crash (see #4873) I could typically fix all breakage by simply running and cleanly exiting either fzf or neovim, but that is not the case here.

@mqudsi
Copy link
Contributor Author

mqudsi commented Jun 19, 2020

I've actually confirmed that this readily reproduces for me via the same steps as #4873 (e.g. in neovim, just execute : kill -SIGABRT (pidof nvim)), but I don't want to group the bugs together as here we have additional breakage in the form of a now-confirmed regression that's quite separate from the clobbered input issues described in that issue.

@mqudsi mqudsi added the regression Something that used to work, but was broken, especially between releases label Jun 19, 2020
@mqudsi
Copy link
Contributor Author

mqudsi commented Jun 19, 2020

Typical stty output:

> stty
speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?; swtch = M-^?;
ixany iutf8
>
> stty -a
speed 38400 baud; rows 36; columns 109; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

stty output after reproducing this issue:

> stty
speed 38400 baud; line = 0;
                           eol = M-^?; eol2 = M-^?; swtch = M-^?; min = 1; time = 0;
                                                                                    -brkint -icrnl ixany iutf8
  -opost
        -isig -icanon -iexten -echo
                                   ¶
>
> stty -a
speed 38400 baud; rows 52; columns 108; line = 0;
                                                 intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q;
                                              stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
                             -parenb -parodd -cmspar cs8 hupcl -cstopb cread -clocal -crtscts
                                                                                             -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc ixany imaxbel iutf8
                                                                                            -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
                                                                -isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho
                                                          -extproc
                                                                  ¶

#4873 does not exhibit a similar change in basic stty output.

@faho
Copy link
Member

faho commented Jun 19, 2020

Have you tried with fish post d5a239e?

@mqudsi
Copy link
Contributor Author

mqudsi commented Jun 19, 2020

Yeah, I get the same regression when running 3.1.2-886-g56a9e698d.

I actually thought I was originally running a build that was after @ridiculousfish's termsize changes but it turns out I was on 1af1e7b.

@faho
Copy link
Member

faho commented Jun 19, 2020

Okay, I can reproduce this:

  • Start nvim (no customization)
  • kill -ABRT the nvim process
  • stty -a shows staircase output
  • stty opost fixes it

So this is down to nvim enabling the "opost" terminal setting, which the stty man page describes as:

postprocess output

I have no idea what that is supposed to mean, but it sounds awful.

@faho
Copy link
Member

faho commented Jun 19, 2020

This would be down to #2315, which allowed changes to the terminal modes to stick. Sounds like we need to disable more.

@mqudsi
Copy link
Contributor Author

mqudsi commented Jun 19, 2020

opost is basically the difference between DOS/UNIX file formats. See https://unix.stackexchange.com/a/402878/30919 :

stty -opost deactivates post-processing output. For example, normally sending a (U+00A0) character to the terminal will automatically insert a (U+000D) character, to make the cursor go to the beginning of the next line.

@faho
Copy link
Member

faho commented Jun 19, 2020

Blergh.

@mqudsi
Copy link
Contributor Author

mqudsi commented Jun 19, 2020

So this is down to nvim enabling the "opost" terminal setting

I think you meant disabling, right?

@faho
Copy link
Member

faho commented Jun 19, 2020

Indeed.

@faho faho closed this as completed in e9e23a8 Jun 19, 2020
@faho
Copy link
Member

faho commented Jun 19, 2020

Let's just force the big ticket items - stuff that entirely breaks all output, that removes showing of input,...

These are good for a program to turn off for its own behavior, but not useful globally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Something that used to work, but was broken, especially between releases
Projects
None yet
Development

No branches or pull requests

3 participants