Hyper: Make keyboard shortcuts (etc.) work as expected on Linux

Created on 23 Dec 2016  ·  7Comments  ·  Source: vercel/hyper

  • OS version and name: Ubuntu 16.04
  • Hyper version: Hyper 1.0.0
  • The issue is reproducible in vanilla Hyper.app: Yes

Issue

First of all, thanks for creating Hyper and keep up the fantastic work! I'm just trying out the 1.0 release on Linux and am really impressed so far — I really want to switch to it as my primary terminal, but there are just a few blockers preventing me from switching yet, mostly to do with the keyboard bindings.

Making shortcuts customizable (#657, #872) will go a long way towards improving this, but I do also wonder if the defaults on Linux should be changed. Could you please make the default keyboard shortcuts on Linux as much as possible like gnome-terminal's? :smile: Maybe the current defaults make sense to those coming from other terminals and maybe I'm too biased by gnome-terminal (as I'm guessing the current defaults are more biased towards Mac/iTerm/Windows conventions), but to me at least some of the defaults aren't what I'd expect.

In general, I expect Ctrl commands to be received by the CLI app, not the terminal. Fortunately it looks many of these commands will be fixed by changing default prefix from Ctrl to Ctrl+Shift (#1191) :crossed_fingers:, including hopefully:

  • Very hard to use vim without accidentally losing everything I'm working on because Ctrl + W closes the tab immediately (#1199, https://github.com/zeit/hyper/issues/1121#issuecomment-267312644).

    • Changing this to Ctrl + Shift + W to match gnome-terminal and asking for confirmation (#684!) will help a lot with this one.

  • Expect to be able to use the standard Readline commands in Bash (http://readline.kablamo.org/emacs.html).

    • Expect Ctrl + K to delete to end of line (https://github.com/zeit/hyper/issues/1199#issuecomment-267254079) but instead it clears the screen

    • Expect Ctrl + A and Ctrl + E to move to the start/end of the current line. Ctrl + E works as expected but Ctrl + A invokes Select All instead.

Other keyboard shortcuts that are currently not as expected and I don't think/am not sure if #1191 would help with:

  • Expect Ctrl + PageUp/PageDown to change tabs (VS Code also uses those keys)
  • Expect Ctrl + Left/Right goes to jump left/right by one word (#1047) but instead jumps to beginning/ending of line
  • Expect Shift + Insert to paste from middle-click buffer but instead inserts the contents of clipboard (#1294)
  • Expect Ctrl + Shift + C to Copy (broken, see #1304)
  • Expect Alt + F to open File menu, Alt + E to open Edit menu, etc. and for the shortcut keys to be underlined while holding Alt.

    • Perhaps see how VS Code does this in Electron: image

Another suggestion for making migration from other terminal apps easier:

  • Add ability to view all keyboard shortcuts (#814)
  • Show the accelerators (next to each command that has one) in the menus

    • image

A few other features I'm missing from gnome-terminal:

  • The ability to move tabs, both by dragging with the mouse and with keyboard (Shift+Ctrl+PageUp/PageDown)
  • When I open a new tab, I'm used to it keeping the same working directory as the tab I was just on. Not sure how they do that but it's nice to not have to manually cd all the way back into some deep subdirectory. I would especially expect this behavior if I'm splitting an existing tab.

All 7 comments

First: really nice issue 👏
Second: PR-welcome 😘

Hi @TylerRick, I like your accelerator suggestions so I updated #1191 to reflect them! I modified the word skip and switch tab accelerators.

I had to skip some, though:

  • I didn't add the middle click buffer since that's probably a bit more work than just messing with the key bindings.
  • I didn't do anything with the alt-key-to-select-menus either for the same reason. I also can't test it super quickly on my end, because menus are totally broken for hyper on Gnome.

Thanks, @nbolten! Yeah, those other ideas are rather unrelated so that's fine. :smile:

Good ideas, @TylerRick!

On your very last point, I think you want this plugin: https://github.com/hharnisc/hypercwd

@TylerRick I suggest you look at https://github.com/ppot/hyper/issues/11
and list in comments the desired keybinding for linux

{
 "window:devtools":"Cmd+Alt+I",
 "window:reload":"Cmd+R",
 "window:reloadFull":"Cmd+Shift+R",
 "window:preferences":"Cmd+,",
 "zoom:reset":"Cmd+0",
 "zoom:in":"Cmd+plus",
 "zoom:out":"Cmd+-",
 "window:new":"Cmd+N",
 "window:minimize": "Cmd+M",
 "window:full": "Cmd-Ctrl-F",
 "window:close":"Cmd+Shift+W",

 "tab:new":"Cmd+T",
 "tab:next":"Cmd+shift+]",
 "tab:prev":"Cmd+shift+[",
 "pane:next":"Cmd+]",
 "pane:prev":"Cmd+[",
 "pane:left":"Cmd+Alt+Left",
 "pane:right":"Cmd+Alt+Right",
 "pane:up":"Cmd+Alt+Up",
 "pane:down":"Cmd+Alt+Down",
 "pane:vertical":"Cmd+D",
 "pane:horizontal":"Cmd+Shift+D",
 "pane:close":"Cmd+W",

 "editor:undo":"Cmd+Z",
 "editor:redo":"Cmd+Shift+Z",
 "editor:cut":"Cmd+X",
 "editor:copy":"Cmd+C",
 "editor:paste":"Cmd+V",
 "editor:selectAll":"Cmd+A",
 "editor:clearBuffer":"Cmd+K",

 "plugins:update": "Cmd+Shift+U"
}

I've searched through the issues and just tried the master branch and I still don't understand one thing ...

I noticed that most of the readline commands still don't work in the terminal.

https://en.wikipedia.org/wiki/GNU_Readline#Emacs_keyboard_shortcuts

Is it possible to define these in the config file or is there work required to be done to make these work ?

Hey there, please try again with the new Hyper v2 release and open a new issue if the problem stills exists. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anthonyettinger picture anthonyettinger  ·  3Comments

rauchg picture rauchg  ·  3Comments

daenuprobst picture daenuprobst  ·  3Comments

ghost picture ghost  ·  3Comments

stan-stripe picture stan-stripe  ·  3Comments