Open gthau opened 1 year ago
Sorta kinda related as a possible workaround, have you experimented with using the edit
command on files, so that it opens it up in an existing VSCode
session?
os:
editCommand: 'code'
editCommandTemplate: '{{editor}} --goto -- {{filename}}:{{line}}'
Sorta kinda related as a possible workaround, have you experimented with using the
edit
command on files, so that it opens it up in an existingVSCode
session?os: editCommand: 'code' editCommandTemplate: '{{editor}} --goto -- {{filename}}:{{line}}'
This is a reasonable workaround, better than using Ctrl+P in VSCode to find my file. Thank you for that.
My setup is a mix mouse-keyboard use. Being able to Alt+Click (same as other interactions in VSCode) would be great. Can those 'os' or customCommands accept "key bindings" with mouse left-right buttons? I couldn't find such examples in the docs.
Can those 'os' or customCommands accept "key bindings" with mouse left-right buttons?
As far as I know - no. But I don't know whether it's a technical limitation (i.e. the underlying library) or just an implementation detail (i.e. "nobody ever needed it before").
In my understanding, we don't need to support key bindings with mouse buttons, but lazygit should ignore the clicks if they are performed with a modifier (Control, Alt, Shift, Option): in that case I think the program that hosts the shell will perform its action (in that case, VSCode will handle the opening of the file, not lazygit). Although I'm not sure of it.
In the meantime, modifying the 'os' editCommand provides a good enhancement of the current situation :)
we don't need to support key bindings with mouse buttons lazygit should ignore the clicks if they are performed with a modifier (Control, Alt, Shift, Option)
Sounds to me they're two sides of the same coin, in both cases we definitely need to intercept mouse clicks - the question is, what should we do with them? :)
In any case, @jesseduffield might know more.
Looking at the keybindings file: https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/keybindings/keybindings.go
It seems MouseLeft, MouseRight, etc. are not supported. However they are supported in gocui
and the underlying termbox-go
lib so it would be possible to add in lazygit.
Describe the bug My git workflow is the following in VSCode:
Terminal: Create New Terminal in Editor Area
lazygit
VSCode's integrated terminal is able to detect URLs, file paths, and branch names to perform some actions by Alt+clicking on them. E.g. you launch an node.js app and there's a compilation issue, you can see the file path in the terminal output and can Alt+Click it to open the file in Editor Area. Very convenient. I'd like to same to work with lazygit.
Unfortunately, there are 2 issues that prevent it: 1/ lazygit seems to ignore the
Alt
key when Alt+clicking and always perform its default action (in case of the Files panel, stage/unstage the file clicked) 2/ for files at the root of the directory, VSCode doesn't recognize it as a file path, only where there is a path separator does it recognize it.Note that if I hover the file path in the Files panel, VSCode shows a hover popup with
Open in Editor
link which I can click to go to the file. This works fine but is a slow user action. What is missing is the ability to use the significantly faster Alt+Click to open the file.To Reproduce Steps to reproduce the behavior (see attached Gif)
Terminal: Create New Terminal in Editor Area
lazygit
Expected behavior Alt+Click should open the file VSCode editor area, same as when clicking on the link in the hover popup. Alt+Click should open the file regardless of where it is in the repo directory (at the root or nested)
Screenshots
Version info:
PS: thank you for lazygit, I love it!