kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.11k stars 972 forks source link

edit-in-kitty does not work #5956

Closed grimm26 closed 1 year ago

grimm26 commented 1 year ago

Describe the bug The edit-in-kitty command fails.

To Reproduce Steps to reproduce the behavior:

  1. use kitty 0.27.0 on linux
  2. try to edit a file using edit-in-kitty
  3. See error: Command 'kitten' not found

Screenshots

image

Environment details

 kitty 0.27.0 () created by Kovid Goyal
Linux mnk-hpbook 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64
Ubuntu 22.04.1 LTS mnk-hpbook /dev/tty

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
Running under: Wayland
Frozen: True
Paths:
  kitty: /home/mkeisler/.local/kitty.app/bin/kitty
  base dir: /home/mkeisler/.local/kitty.app/lib/kitty
  extensions dir: /home/mkeisler/.local/kitty.app/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /home/mkeisler/.config/kitty/kitty.conf

Config options different from defaults:
copy_on_select                     clipboard
cursor_shape                       3
cursor_stop_blinking_after         0
editor                             nvim
enable_audio_bell                  False
enabled_layouts                    ['grid', 'fat:bias=70;full_size=1;mirrored=false', 'splits', 'tall', 'stack']
env:
{'PATH': '/home/mkeisler/.local/bin:/usr/local/bin:/home/mkeisler/.pyenv/shims:/home/mkeisler/.pyenv/bin:/home/mkeisler/.local/bin:/home/mkeisler/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mkeisler/go/bin:/usr/local/go/bin:/usr/local/nodejs/bin'}
focus_follows_mouse                True
font_family                        Hack Nerd Font Mono
font_size                          12.0
initial_window_height              (600, 'px')
initial_window_width               (1000, 'px')
macos_quit_when_last_window_closed True
remember_window_size               False
scrollback_pager                   ['/home/mkeisler/.config/kitty/pager.sh', 'INPUT_LINE_NUMBER', 'CURSOR_LINE', 'CURSOR_COLUMN']
scrollback_pager_history_size      10485760
select_by_word_characters          @-./_~?&%+#
shell                              zsh --login --interactive
shell_integration                  frozenset({'no-cursor'})
show_hyperlink_targets             True
tab_bar_edge                       1
tab_bar_min_tabs                   1
tab_bar_style                      powerline
tab_title_template                 {fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}:{layout_name}
window_logo_alpha                  0.2
window_logo_path                   /home/mkeisler/.config/kitty/logos/shrivatsa.png
Changed mouse actions:
    left click ungrabbed →  mouse_handle_click selection link
Added shortcuts:
    ctrl+c →  copy_or_interrupt
    ctrl+v →  paste_from_clipboard
    f1 →  show_kitty_doc kittens/ssh
    kitty_mod+/ →  launch --location=hsplit --allow-remote-control kitty +kitten search.py @active-kitty-window-id
    kitty_mod+f3 →  launch --allow-remote-control kitty +kitten broadcast
    kitty_mod+p →  last_used_layout
    shift+down →  move_window down
    shift+left →  move_window left
    shift+right →  move_window right
    shift+up →  move_window up
Removed shortcuts:
    kitty_mod+p > f →  kitten hints --type path --program -
    kitty_mod+p > h →  kitten hints --type hash --program -
    kitty_mod+p > l →  kitten hints --type line --program -
    kitty_mod+p > n →  kitten hints --type linenum
    kitty_mod+p > shift+f →  kitten hints --type path
    kitty_mod+p > w →  kitten hints --type word --program -
    kitty_mod+p > y →  kitten hints --type hyperlink
Changed shortcuts:
    kitty_mod+enter →  new_window_with_cwd
    kitty_mod+z →  toggle_layout stack
Colors:
    active_tab_background              #268bd2   
    active_tab_foreground              #181926   
    background                         #001217   
    color0                             #002b36   
    color1                             #dc322f   
    color10                            #465a61   
    color11                            #52676f   
    color12                            #708183   
    color13                            #6c71c4   
    color14                            #81908f   
    color15                            #fcf4dc   
    color2                             #859900   
    color3                             #b58900   
    color4                             #268bd2   
    color5                             #d33682   
    color6                             #2aa198   
    color7                             #e9e2cb   
    color8                             #001e26   
    color9                             #cb4b16   
    cursor                             #708183   
    foreground                         #708183   
    inactive_tab_background            #586e75   
    inactive_tab_foreground            #cad3f5   
    selection_background               #fcf4dc   
    selection_foreground               #001e26   
    tab_bar_background                 #073642   

Important environment variables seen by the kitty process:
    PATH                                /home/mkeisler/.pyenv/shims:/home/mkeisler/.pyenv/bin:/home/mkeisler/.local/bin:/home/mkeisler/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mkeisler/go/bin:/usr/local/go/bin:/usr/local/nodejs/bin
    LANG                                en_US.UTF-8
    EDITOR                              nvim
    SHELL                               /bin/zsh
    DISPLAY                             :0
    WAYLAND_DISPLAY                     wayland-0
    USER                                mkeisler
    XDG_SESSION_TYPE                    wayland
    XDG_SESSION_CLASS                   user
    LC_COLLATE                          C
    XDG_RUNTIME_DIR                     /run/user/1000
    XDG_MENU_PREFIX                     gnome-
    XDG_CURRENT_DESKTOP                 ubuntu:GNOME
    XDG_SESSION_DESKTOP                 ubuntu
    XDG_DATA_DIRS                       /usr/local/share/:/usr/share/:/var/lib/snapd/desktop
kovidgoyal commented 1 year ago

Add /home/mkeisler/.local/kitty.app/bin/ to PATH and it will work, I will have shell integration do that automatically in the next release.

kovidgoyal commented 1 year ago

Actually, it should be in PATH already. You are presumably overwriting PATH in some shell rc script. If you do that then you need to add the PATH manually.

page-down commented 1 year ago

Before, kitty had only one executable, however, now there are two (kitty, kitten).

If your PATH does not contain the kitty bin folder, but uses symbolic links, then you need to create one for kitten as well.

ln -sf $HOME/.local/kitty.app/bin/kitty ~/.local/bin/kitty
ln -sf $HOME/.local/kitty.app/bin/kitten ~/.local/bin/kitten

@kovidgoyal I think the documentation needs to be updated. Now it's two.

https://sw.kovidgoyal.net/kitty/binary/

Do not copy the kitty binary ... create a symlink in ...
kovidgoyal commented 1 year ago

@page-down done

grimm26 commented 1 year ago

I'm not overwriting PATH, but I am using a symlinked kitty instead of having ~/.local/kitty.app/bin in my PATH.

kovidgoyal commented 1 year ago

Ah yes, the you have to symlink kitten as well.

@page-down could you please implement https://github.com/kovidgoyal/kitty/commit/47641456dad9fee3e228dfa8361fdc88db317861 for the fish shell, I am not sure of the best way to do so there.

grimm26 commented 1 year ago

I went ahead and just added the kitty bin directory to my path instead.

kovidgoyal commented 1 year ago

Yeah either will work and with my last commit, edit-in-kitty will use the full path to kitten anyway.