Skip to content

Term size issues after ncurses app crash #7133

Closed

Description

@mqudsi

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.

Activity

  1. mqudsi commented on Jun 19, 2020

    @mqudsi
    ContributorAuthor

    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.

  2. added
    regression
    on Jun 19, 2020
  3. mqudsi commented on Jun 19, 2020

    @mqudsi
    ContributorAuthor

    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.

  4. faho commented on Jun 19, 2020

    @faho
    Member

    Have you tried with fish post d5a239e?

  5. mqudsi commented on Jun 19, 2020

    @mqudsi
    ContributorAuthor

    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.

  6. faho commented on Jun 19, 2020

    @faho
    Member

    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.

  7. faho commented on Jun 19, 2020

    @faho
    Member

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

  8. mqudsi commented on Jun 19, 2020

    @mqudsi
    ContributorAuthor

    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.

  9. faho commented on Jun 19, 2020

    @faho
    Member

    Blergh.

  10. mqudsi commented on Jun 19, 2020

    @mqudsi
    ContributorAuthor

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

    I think you meant disabling, right?

  11. faho commented on Jun 19, 2020

    @faho
    Member

    Indeed.

  12. faho commented on Jun 19, 2020

    @faho
    Member

    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.

  13. added this to the fish 3.2.0 milestone on Jun 22, 2020
  14. locked as resolved and limited conversation to collaborators on Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    regression

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions