gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Can't get Arrow keys to work in Konsole on Kubuntu

Open dr-kristau opened this issue 3 years ago • 13 comments

Describe the bug I can use the arrow keys in Konsole to see my command history, for example, but I can't get the arrow keys to work in gitui.

Context (please complete the following information):

  • Kubuntu 21.10
  • gitui v0.18.0
  • rustc 1.56.1

Additional context Arrow keys work fine in gnome-terminal on Ubuntu 20.04.3, not sure why they're not working here.

dr-kristau avatar Dec 02 '21 21:12 dr-kristau

Can you check if arrow keys work in other apps like tig in the same terminal?

extrawurst avatar Dec 03 '21 07:12 extrawurst

Unfortunately tig doesn't seem to build for me at the moment: Screenshot_20211203_094235

However, the arrow keys do work on the 'sort by' menu of htop: Screenshot_20211203_094301

dr-kristau avatar Dec 03 '21 08:12 dr-kristau

Ok weird

extrawurst avatar Dec 03 '21 20:12 extrawurst

Seeing the same issue on macOS in iTerm2:

ProductName: macOS ProductVersion: 11.6 BuildVersion: 20G165

iTerm2: Build 3.5.0beta3

zsh: 5.8 (x86_64-apple-darwin20.0)

egrieco avatar Jan 09 '22 01:01 egrieco

@egrieco maybe a iterm2 beta issue? works fine for me on 3.4.14

extrawurst avatar Jan 09 '22 14:01 extrawurst

In case the root cause is the same, I'm also unable to get arrow keys to work on macOS, but using the default Terminal.app. On macOS 12.1, using GitUI 0.19.0 from nixpkgs. Arrow keys work per normal in all other terminal apps, including tig.

callahad avatar Jan 10 '22 01:01 callahad

@callahad same for the regular Mac terminal app: works on my end. can it be a config in your terminal eating those commands? or did you remap something?

extrawurst avatar Jan 10 '22 09:01 extrawurst

Fascinating! I don't have any weird customizations to my terminal (heck, I'm even using the built-in Terminal.app; not iTerm2 or Kitty or anything).

...oh no. Now it's working. I haven't changed a thing. This is going to be one of those bugs.

Last night:

  • Installed gitui, noticed arrow keys didn't work but all other keys did (numbers to switch tabs, o to open options, esc to close it, etc.)
  • Added the example vim-style key_bindings.ron
  • Verified that hjkl worked to navigate gitui

This morning:

  • Installed iTerm2, hjkl worked as expected
  • Quit gitui and removed the key_bindings.ron file
  • Arrow keys worked in iTerm2
  • ...and then also arrow keys worked in Terminal.app

This is in the same exact Terminal.app session from last night; I never closed the window or exited my shell. And yet, now it works.

callahad avatar Jan 10 '22 09:01 callahad

Maybe a rogue key-logger 🤣

extrawurst avatar Jan 10 '22 09:01 extrawurst

@Dr-Kristau I can't find anything we can do about it and plenty of people have managed to use arrow keys in gitui without issues on all three major platforms. unless we get new insight I am inclined to mark this as closed

extrawurst avatar Jan 10 '22 21:01 extrawurst

@extrawurst I guess if you can't reproduce it and I can't fix it then you might as well!

dr-kristau avatar Jan 11 '22 08:01 dr-kristau

@egrieco maybe a iterm2 beta issue? works fine for me on 3.4.14

@extrawurst Might have been memory corruption. The issue seems to be resolved for me after a restart.

egrieco avatar Jan 17 '22 02:01 egrieco

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 30 '22 18:07 stale[bot]

Same issue on WSL2. wsl-mintty and tmux. fish on Ubuntu 20.04. gitui 0.19.0.

All keys work except moving with arrow keys. Arrow keys work in fish and less and other programs I could think of.

The issue is intermittent. On entry to the program the arrow keys are not working. The issue resolves in a new tmux session or new terminal window. Happens every other day or so.

I have never seen it resolve by itself in the same fish session. Does not resolve by changing to a different git folder or changing folders within the repo or using the git cli or anything.

I think I saw it happen when running bash, but couldn't swear. I have never had it happen in Windows cmd in Windows terminal, but then again I usually don't have long lived sessions in windows, so less chance of it happening?

l1n3n01z avatar Feb 02 '23 13:02 l1n3n01z

Was fixed in v0.22.0 See https://github.com/extrawurst/gitui/issues/1533#issuecomment-1514778029

l1n3n01z avatar Apr 19 '23 13:04 l1n3n01z