lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

ESC does not quit the application

Open MiroslavMikus opened this issue 4 years ago • 14 comments

Describe the bug ESC does not quit the application

To Reproduce Open lazy git and press ESC.

Expected behavior The application should be closed like in version 0.25.1

Desktop: OS: Windows 10.0.19042 Terminal: WindowsTerminal 1.6.10571.0 Powershell: 7.1.3 Lazygit Version 0.27.4

MiroslavMikus avatar Apr 13 '21 15:04 MiroslavMikus

Found right now, I cant navigate to the next tab with ] or open the tree view with `

MiroslavMikus avatar Apr 13 '21 16:04 MiroslavMikus

I have found the memo :man_facepalming: The ESC feature was replaced with q or CTRL+c.

MiroslavMikus avatar Apr 13 '21 16:04 MiroslavMikus

I need to get better at communicating changes haha. I think I need a 'click here to see what's changed' popup when starting lazygit on a new version, which links to a nicely formatted release notes page on github

jesseduffield avatar Apr 14 '21 09:04 jesseduffield

Some more info to the comment here. Since the new UI framework, I can't use any key combination anymore. For example: in order to enter ] I have to press ctrl+alt+9 since I'm using GER keyboard layout. In the version, 25.xx was everything just fine.

Since version 27 is not working anymore. The easiest workaround is the config.yml keybinding section.

Now to the problem. Since version 28 we have a very nice Command Log tab, which can be focused with @ so I have to press ctrl+alt+q (I know, horrible 😄 ). AFAIK there is no custom binding yet to customize this command. Therefore I'm not able to select this tab without switching my keyboard layout.

MiroslavMikus avatar Apr 26 '21 08:04 MiroslavMikus

@MiroslavMikus that's annoying.
How have you modified your config.yml to make the keybindings work again?

mjarkk avatar Jul 29 '21 12:07 mjarkk

About the command log keybinding i think you need this config to modify it:

keybinding:
  universal:
    extrasMenu: '@'

This keybinding wan't mentioned in the docs but now it does

mjarkk avatar Jul 29 '21 12:07 mjarkk

Hey @mjarkk , thanks for the memo :) works like a charm.

@jesseduffield If is the disability to use a combined shortcut like ctrl+alt+q to call functions behind @ known and accepted behavior, we can close this issue :)

MiroslavMikus avatar Jul 29 '21 12:07 MiroslavMikus

Well you mention that from v25 to v27 you need to press extra keys for some keyboard shortcuts and as there are a lot of users around the world with messed up keyboard layouts we might want to look into this if we can fix it.

mjarkk avatar Jul 29 '21 13:07 mjarkk

Is it possible to define a custom key binding that makes pressing quit lazygit?

mvolkmann avatar Apr 15 '23 00:04 mvolkmann

@mvolkmann yes, check the docs to see how to override the keybinding.universal.quit mapping.

mark2185 avatar Apr 15 '23 06:04 mark2185

I tried this in my ~/.config/lazygit/config.yml file, but pressing the esc key doesn't quit. Do you see what I'm doing wrong?

git:
  keybinding:
    universal:
      quit-alt1: "<esc>"
  paging:
    colorArg: always
    pager: delta --dark --paging=never --side-by-side
    useConfig: true
  quitOnTopLevelReturn: true
gui:
  showIcons:
    true

Side note, my attempt to configure side-by-side diffs is also not working.

mvolkmann avatar Apr 15 '23 15:04 mvolkmann

I tried this in my ~/.config/lazygit/config.yml file, but pressing the esc key doesn't quit. Do you see what I'm doing wrong?

git:
  keybinding:
    universal:
      quit-alt1: "<esc>"
  paging:
    colorArg: always
    pager: delta --dark --paging=never --side-by-side
    useConfig: true
  quitOnTopLevelReturn: true
gui:
  showIcons:
    true

If you take a look at the Config.md in the docs, the keybinding is not under git, but at the top-level (this excerpt is from said file):

keybinding:
  universal:
    quit: 'q'
    quit-alt1: '<c-c>' # alternative/alias of quit

Side note, my attempt to configure side-by-side diffs is also not working.

I haven't used a custom pager, but I encourage you to come and ask on discord, surely someone will be of help.

mark2185 avatar Apr 15 '23 21:04 mark2185

The configuration you shared works for me to enable quitting by pressing ctrl-c. But if I change "c-c" to "esc", pressing the escape key does not quit. I wonder if it's not possible to configure that to work.

mvolkmann avatar Apr 15 '23 23:04 mvolkmann

quitOnTopLevelReturn is a top-level config. It should not be nested inside git config. That is why it is not triggering for you.

diegodorado avatar Jan 28 '24 18:01 diegodorado