8000 lnav exits with ANSI escape sequences in terminal with key reporting enabled · Issue #1640 · tstack/lnav · GitHub
[go: up one dir, main page]

Skip to content

lnav exits with ANSI escape sequences in terminal with key reporting enabled #1640

@maybephilipp

Description

@maybephilipp

lnav version
v0.13.2

Describe the bug

Two scenarios happening:

  1. Happens all the time: when I enter lnav with lnav mylog.log and alike command, exiting it by all ctrl+c, q, :quit prints some sequence to terminal like:
ubuntu@findev:~/docker/api/logs$ lnav others.cab.*.log
ubuntu@findev:~/docker/api/logs$ 9;5:3u442;1:3u
ubuntu@findev:~/docker/api/logs$ lnav others.cab.*.log
ubuntu@findev:~/docker/api/logs$ 3;1:3u
  1. Happens rarely and randomly: when I enter lnav with lnav bla*bla.log and alike command, it loads lnav with command line (the line for entering commands below lnav, like :9;5:3u442;1:3u) full of random sequence and lnav isn't responding to hotkeys normally (ctrl+c few times and reopening lnav loads it normally).

To Reproduce
Steps to reproduce the behavior:
on macOS, iTerm 3.6.8 (this is the latest, but many many previous versions had same issue)
My default settings had this option enabled: Settings -> Profiles -> Hotkey window -> Keys -> General -> "Apps can change how keys are reported". Asking GPT-5.4 helped me to clarify that this is because of CSI key reporting in modern terminals. After turning this option off, it works perfectly.

  1. Enter SSH session
  2. Run lnav even without files passed - still has the bug
  3. Exit with any of ctrl+c, q, :quit

Also a note: built-in macOS's Terminal app doesn't have this issue too, but this is most likely because they don't support CSI key reporting or smth like that.

GPT suggests that it's because lnav didn't clear/shutdown properly. Actually I remember I didn't have this issue in iTerm before. I will try with older lnav now and report it in the comments below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0