Closed mmindenhall closed 1 year ago
I suggest you try running moar
with --trace
both inside and outside of atuin
and try to repro the issue.
Then check what the difference is in the two logs presented by moar
.
Pressing down arrow will be logged as Handling key event 5...
, look for that to see whether moar
even gets the arrow events after atuin
is done doing its thing.
Hi @walles,
I ran moar --trace README.md
in a new terminal window, before and after invoking the atuin search UI. Atuin is changing the key event/sequence for the arrow keys. In each case, I did the following:
Here are the results.
$ moar --trace README.md
Please post the following report at <https://github.com/walles/moar/issues>,
or e-mail it to johan.walles@gmail.com.
Version: v1.15.1
LANG : en_US.UTF-8
TERM : xterm-256color
GOOS : darwin
GOARCH : arm64
Compiler: gc
NumCPU : 10
DEBU[0000] Stream read in 0ms
TRAC[0000] Pager starting
TRAC[0000] Reader done, no filter
TRAC[0000] Reader done, contents explicitly set
TRAC[0000] Highlighting done
TRAC[0001] ttyin high watermark bumped to 3 bytes
TRAC[0001] Handling key event 5...
TRAC[0001] Handling key event 5...
TRAC[0001] Handling key event 5...
TRAC[0001] Handling key event 5...
TRAC[0002] Handling key event 5...
TRAC[0002] Handling key event 4...
TRAC[0003] Handling key event 4...
TRAC[0003] Handling key event 4...
TRAC[0003] Handling key event 4...
TRAC[0003] Handling key event 4...
TRAC[0004] Handling key event 6...
TRAC[0004] Handling key event 6...
TRAC[0004] Handling key event 6...
TRAC[0005] Handling key event 7...
TRAC[0005] Handling key event 7...
TRAC[0005] Handling key event 7...
TRAC[0008] Handling rune event 'q'/0x0071...
TRAC[0008] Pager done
$ moar --trace README.md
DEBU[0000] Counted 88 lines in 0ms at 102ns/line
DEBU[0000] Stream read in 0ms
TRAC[0000] Reader done, no filter
Please post the following report at <https://github.com/walles/moar/issues>,
or e-mail it to johan.walles@gmail.com.
Version: v1.15.1
LANG : en_US.UTF-8
TERM : xterm-256color
GOOS : darwin
GOARCH : arm64
Compiler: gc
NumCPU : 10
TRAC[0000] Pager starting
TRAC[0000] Reader done, contents explicitly set
TRAC[0000] Highlighting done
TRAC[0001] ttyin high watermark bumped to 3 bytes
DEBU[0001] Unhandled multi character terminal escape sequence(s): B
DEBU[0001] Unhandled multi character terminal escape sequence(s): B
DEBU[0001] Unhandled multi character terminal escape sequence(s): B
DEBU[0001] Unhandled multi character terminal escape sequence(s): B
DEBU[0001] Unhandled multi character terminal escape sequence(s): B
DEBU[0002] Unhandled multi character terminal escape sequence(s): A
DEBU[0002] Unhandled multi character terminal escape sequence(s): A
DEBU[0002] Unhandled multi character terminal escape sequence(s): A
DEBU[0002] Unhandled multi character terminal escape sequence(s): A
DEBU[0003] Unhandled multi character terminal escape sequence(s): A
DEBU[0004] Unhandled multi character terminal escape sequence(s): C
DEBU[0004] Unhandled multi character terminal escape sequence(s): C
DEBU[0004] Unhandled multi character terminal escape sequence(s): C
DEBU[0005] Unhandled multi character terminal escape sequence(s): D
DEBU[0005] Unhandled multi character terminal escape sequence(s): D
DEBU[0005] Unhandled multi character terminal escape sequence(s): D
TRAC[0006] Handling rune event 'q'/0x0071...
TRAC[0006] Pager done
I don't understand what side effect atuin
is having that causes this problem, but it's notable that moar
is the only tool (so far) that is affected. This makes me wonder whether the key event mapping/subscription in moar
could be extended to include these "Unhandled multi character terminal escape sequence(s)"?
Hi! Can you try again with this binary?
It's the latest release exactly with only 6abe5ba and 15a90f5f77644 applied to it. That should make the Unhandled multi character
printouts actionable for me.
Right now, when the printout says B
, it really means <ESC>somethingBmaybesomethingelse
, but the ESC character gets eaten by your terminal so I can't know what really happened here.
I think these are the sequences we should be getting, but that's apparently not what's happening: https://github.com/walles/moar/blob/6abe5ba1b138108478118f360c47324f40df515e/twin/keys.go#L49-L52
OK, here's what I get with that binary after running atuin
.
$ ~/tmp/moar --trace README.md
DEBU[0000] Counted 88 lines in 0ms at 670ns/line
DEBU[0000] Stream read in 0ms
TRAC[0000] Reader done, no filter
Please post the following report at <https://github.com/walles/moar/issues>,
or e-mail it to johan.walles@gmail.com.
Version: v1.15.1-2-g15a90f5
LANG : en_US.UTF-8
TERM : xterm-256color
GOOS : darwin
GOARCH : amd64
Compiler: gc
NumCPU : 10
TRAC[0000] Pager starting
TRAC[0000] Reader done, contents explicitly set
TRAC[0000] Highlighting done
TRAC[0000] ttyin high watermark bumped to 3 bytes
DEBU[0000] Unhandled multi character terminal escape sequence(s): {<0x1b>OB}
DEBU[0001] Unhandled multi character terminal escape sequence(s): {<0x1b>OA}
DEBU[0001] Unhandled multi character terminal escape sequence(s): {<0x1b>OC}
DEBU[0002] Unhandled multi character terminal escape sequence(s): {<0x1b>OD}
TRAC[0003] Handling rune event 'q'/0x0071...
TRAC[0003] Pager done
Also, the author of atuin
responded late yesterday, and it looks like the command echoti smkx
is responsible for the side-effect that is throwing things off in moar
. If you use zsh
, you should be able to run that command and then run moar
to reproduce the behavior.
Fixed by daafbcdac4cc826d670a58bf9a6f9ef495159997.
Hello,
I'm seeing a very strange and unexpected interaction between atuin and
moar
within my CLI environment. I reported an atuin issue, but wanted to report here as well.Here's what happens.
atuin
andmoar
configured in my ZSH environmentmoar
any of the following ways:moar README.md
)more
ctrl-r
(mapped toatuin
), I see theatuin
history search interface in the terminal window. I can search for a previous command, or simply hitesc
to dismiss.moar
in the same terminal window, I can no longer navigate through paged content using the arrow keys.moar
. If I try to page the same file using the built-inmore
orless
tools, the arrow keys still work.@walles, are you aware of anything that
atuin
might be doing within the shell environment that could explain this strange side effect inmoar
?How to reproduce
After following the installation instructions for
atuin
, I'm enabling it in my.zshrc
:I also have the following environment variables defined to use
moar
as my pager and manpager:I have created an alias for
more
: