WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Navigation keys and htop over SSH Session : Problems scrolling

Open ghost opened this issue 10 years ago • 4 comments

When using htop on the local machine, navigation and function keys function properly, however, when htop is used in a SSH session, the navigation and function keys don't work correctly.

Using navigation keys in htop should allow to scroll up/down or left/right in the processes list. Pressing right key, e.g. opens up the htop options page (opens by default when F2 key is pressed) Also, Pressing F10 does not close htop, but trying to scroll up/down and then pressing F10 works and htop exits.

Using Windows 10 Pro 14393.105

Required steps Open a new SSH session to a remote computer Open htop Scroll right opens htop options page Scroll left takes back to process view Scroll up/down works but with problems

ghost avatar Sep 11 '16 21:09 ghost

Scrolling with htop does not work in other terminals outside of the WSL environment, so that part is likely not a WSL console issue. I use htop in WSL using lxterminal, and it behaves the same as it would using lxterminal on a GNU/Linux distro (does not scroll, scroll bar is maximized while running htop). See https://github.com/hishamhm/htop/issues/322 and related.

When I run htop in the WSL console, it seems to behave the same as it does in lxterminal. (scroll bar become maxiumized).

Does F10 work for other apps for you in the console? For me it exits htop ( both in the WSL console and in LXTerminal running on WSL).

Note: However, F10 does not exit htop when I ssh from the WSL to the remote machine. It exits htop when I run it locally. F10 does exit htop when accessing the remote machine from LXTerminal running on WSL.

Update: For me scrolling up/down work via arrow keys both with the WSL console and LXTerminal. (running htop locally and remotely). For left/right arrow keys, I might get one or 2 key presses in the WSL console, then it defaults to bringing up options. In LXTerminal right/left arrow keys work as expected (locally/remotely)

  • My WSL environment:
    • Edition: Windows 10 Enterprise
    • Version: 1607
    • OS Build: 14393.0
  • In WSL environment:
$ htop --version
htop 1.0.2 - (C) 2004-2011 Hisham Muhammad
Released under the GNU GPL.
  • On remote machine:
$ htop --version
htop 2.0.1 - (C) 2004-2016 Hisham Muhammad
Released under the GNU GPL.
  • LXTerminal 0.1.11
  • In general I only use a regular Linux terminal in WSL (such as LXTerminal), as the WSL console is not what I'm used to.
  • Summary (when using htop in the WSL console):
    • I get similar left/right misbehavior to what atifraza is reporting (when using remote htop)
    • F10 works for local htop for me, not for remote htop.
    • Left/Right arrow keys work correctely for me with local htop.
    • Up/Down arrow keys work correctly for me.
  • Thoughts on this issue:
    • If I were to guess, I would say this likely a pty issue.

bogen avatar Sep 17 '16 15:09 bogen

Update:

  • Using the mintty console installed with "Git for Windows" does not have the problem and if one opens an SSH session in mintty console, and runs htop, the key scrolling works just as it is supposed to work. Also, the Function keys work fine as well.
  • Also, if bash is launched from within mintty then navigation and functions keys again function properly.

So the problem arises when bash is launched from the default shortcut or from a Windows command prompt console. I haven't checked any console settings yet.

ghost avatar Sep 17 '16 18:09 ghost

I have exactly the same problem and I don't found a solution. I have read the referenced issue, but I don't undestand the relation with this issue.

todojs avatar Feb 05 '17 22:02 todojs

Thanks for the discussion.

Closing this issue since:

  1. This issue is very old and has likely been fixed in recent Win10 builds
  2. This is the WSL issues repo, but this is an issue in Console which has its own Console GitHub Repo
  3. GitHub doesn't allow issues to be moved between repos, preserving posters' identity :(

If you have further asks/issues, please file new issues on our Console GitHub Repo.

bitcrazed avatar May 22 '18 22:05 bitcrazed