walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
587 stars 17 forks source link

crash: Pressing Pause/Break key crashes on Windows Terminal #126

Closed simsrw73 closed 10 months ago

simsrw73 commented 1 year ago

Doesn't matter which shell: pwsh or cmd, both exhibit the same behavior. But it only seems to affect Windows Terminal. Does not affect WezTerm or Alacritty.

Pressing the Break key terminates moar break It terminates moar and leaves the terminal in a somewhat broken state: trying to scroll the buffer with mouse or use cursor keys just output escape sequences to the terminal.

walles commented 1 year ago

That panic is in twin's main loop. Apparently stdin gets closed when you do that:

https://github.com/walles/moar/blob/c99c2e127aa72f9a59f8478541789f98f39d5ced/twin/screen.go#L207-L210

walles commented 10 months ago

@simsrw73 can you try this build and see what happens?

I don't have access to Windows so I can't test it myself.

Not sure whether this fixes the whole problem, but I think it is at least one step on the way.

moar-v1.15.4-1-g5a33eda-windows-amd64.exe.gz

walles commented 10 months ago

I believe this should work in 1.16.0.

If not, please comment + reopen!