Skip to content

Kitten difftool crashes on launch #6611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
elliotwesoff opened this issue Sep 9, 2023 · 3 comments
Closed

Kitten difftool crashes on launch #6611

elliotwesoff opened this issue Sep 9, 2023 · 3 comments
Labels

Comments

@elliotwesoff
Copy link

Describe the bug
Attempting to use the kitty difftool errors and prints a stack trace.

Strangely, the kitty difftool works correctly in most other repositories on my system. The diff on this repository is purely mode changes on the entire repo. I was literally instructed to run chmod -R 755 .

To Reproduce
Steps to reproduce the behavior:

  1. Use the following git difftool config in ~/.gitconfig:
[diff]
    tool = kitty
    guitool = kitty.gui
[difftool]
    prompt = false
    trustExitCode = true
[difftool "kitty"]
    cmd = kitty +kitten diff $LOCAL $REMOTE
[difftool "kitty.gui"]
    cmd = kitty kitty +kitten diff $LOCAL $REMOTE
  1. Clone the repository: https://github.com/mit-pdos/xv6-riscv
  2. Recursively change the file modes in the repo: chmod -R 755 xv6-riscv
  3. Run the command git difftool --no-symlinks --dir-diff
  4. Be sad because the wonderful kitty difftool doesn't launch
  5. Observe the stack trace:
elliot@cavejohnson ~/c/xv6 (riscv)> git difftool --no-symlinks --dir-diff

Paniced with error: runtime error: slice bounds out of range [:-1]
Stacktrace:
goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x5e
kitty/tools/tui/loop.(*Loop).Run.func1()
	kitty/tools/tui/loop/api.go:244 +0x66
panic({0x562c44ea9880?, 0xc000420000?})
	runtime/panic.go:914 +0x21f
kitty/kittens/diff.render(0xc000418a20?, 0xc0004320f0, {0x2c, 0xf0, 0x2b, 0x8, 0x18}, 0x562c4454fca6?, {0x0, 0x0})
	kitty/kittens/diff/render.go:755 +0x232
kitty/kittens/diff.(*Handler).render_diff(0xc0002003c0)
	kitty/kittens/diff/ui.go:301 +0xad
kitty/kittens/diff.(*Handler).handle_async_result(0xc0002003c0, {{0x0, 0x0}, 0x1, 0x0, 0xc0004320f0, {0x0, 0x0}})
	kitty/kittens/diff/ui.go:256 +0x245
kitty/kittens/diff.(*Handler).on_wakeup(0xc0002003c0)
	kitty/kittens/diff/ui.go:169 +0xe5
kitty/tools/tui/loop.(*Loop).run(0xc0002001e0)
	kitty/tools/tui/loop/run.go:433 +0x142e
kitty/tools/tui/loop.(*Loop).Run(0x0?)
	kitty/tools/tui/loop/api.go:261 +0x65
kitty/kittens/diff.main(0xc000150000?, 0x562c44e0eb40?, {0xc000115a80, 0x2, 0xc000291528?})
	kitty/kittens/diff/main.go:161 +0x61b
kitty/kittens/diff.create_cmd.func1(0x562c44e3f300?, {0xc000115a80, 0x2, 0x8})
	kitty/kittens/diff/cli_generated.go:15 +0x8e
kitty/tools/cli.(*Command).ExecArgs(0x562c44ab992c?, {0xc000024080?, 0xc000150a00?, 0xc000186000?})
	kitty/tools/cli/command.go:549 +0x2b4
kitty/tools/cli.(*Command).Exec(0xc000186000?, {0x0?, 0x562c44ac2200?, 0xc00009e058?})
	kitty/tools/cli/command.go:567 +0x32
main.main()
	kitty/tools/cmd/main.go:33 +0x10d
Press any key to exit.

Screenshots
N/A

Environment details

kitty 0.29.2 created by Kovid Goyal
Linux cavejohnson 6.4.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64
Arch Linux 6.4.12-arch1-1 (/dev/tty)

Running under: X11
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/fish
Loaded config files:
  /home/elliot/dotfiles/.config/kitty/kitty.conf
  /home/elliot/dotfiles/.config/kitty/condensed.conf

Config options different from defaults:
allow_remote_control       yes
copy_on_select             clipboard
cursor_blink_interval      0.0
cursor_shape               3
cursor_stop_blinking_after 4.0
draw_minimal_borders       False
font_family                IntelOne Mono
font_size                  10.0
hide_window_decorations    1
italic_font                Meslo LGM Nerd Font
modify_font:
    cell_height 5
mouse_hide_wait            1.0
shell_integration          frozenset({'no-cursor'})
single_window_margin_width FloatEdges(left=0.0, top=0.0, right=0.0, bottom=0.0)
visual_bell_duration       0.5
window_border_width        (0, 'pt')
Colors:
	background                 #202020   
	color0                     #151515   
	color1                     #ac4142   
	color10                    #7e8d50   
	color11                    #e5b566   
	color12                    #6c99ba   
	color13                    #9e4e85   
	color14                    #7dd5cf   
	color15                    #f5f5f5   
	color2                     #7e8d50   
	color3                     #e5b566   
	color4                     #6c99ba   
	color5                     #9e4e85   
	color6                     #7dd5cf   
	color7                     #d0d0d0   
	color8                     #505050   
	color9                     #ac4142   
	cursor                     #d0d0d0   
	foreground                 #d0d0d0   
	selection_background       #eecb8b   
	selection_foreground       #232323   

Important environment variables seen by the kitty process:
	PATH                                /home/elliot/.asdf/shims:/opt/asdf-vm/bin:/home/elliot/.local/share/gem/ruby/3.1.0/bin:/home/elliot/.local/share/gem/ruby/3.0.0/bin:/home/elliot/.local/share/gem/ruby/3.1.0:/home/elliot/.cargo/bin:/home/elliot/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
	LANG                                en_US.UTF-8
	EDITOR                              nvim
	SHELL                               /bin/fish
	DISPLAY                             :0
	USER                                elliot
	XDG_SESSION_CLASS                   user
	XDG_RUNTIME_DIR                     /run/user/1000
	XDG_SESSION_ID                      1
	XDG_VTNR                            1
	XDG_SESSION_TYPE                    tty
	XDG_SEAT                            seat0

Additional context
The problem persists in a kitty instance initialized with kitty --config NONE

@kovidgoyal
Copy link
Owner

Well actually that commit wont be enough, will need more work

@kovidgoyal kovidgoyal reopened this Sep 9, 2023
@kovidgoyal
Copy link
Owner

Basically the diff consists only of mode changes which the diff kitten doesnt support. The empty changeset is causing the panic, I can prevent that easily enough but ideally it should show the mode change

@elliotwesoff
Copy link
Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants