jesseduffield / jesseduffield/lazygit
Open file with Alt+Click in VSCode integrated terminal
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
My git workflow is the following in VSCode:
- I open an integrated terminal within the Editor Area using the command `Terminal: Create New Terminal in Editor Area`
- within this integrated terminal, I launch `lazygit`
- there I perform all git related actions
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)
1. Open VSCode
2. open terminal in editor area using the command `Terminal: Create New Terminal in Editor Area`
3. launch `lazygit`
4. Modify some file at the root of the directory and some other file in (nested) directory so those files appear in lazygit's Files panel
5. Try to hover the file paths and click VSCode link in the hover popup
6. Try to Alt+Click the file paths
**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:**
```
$ lazygit --version
commit=16802a048e0425182f08cf0e9a2bc31480e9a55d, build date=2023-02-01T11:02:43Z, build source=binaryRelease, version=0.37.0, os=linux, arch=amd64, git version=2.30.2
```
PS: thank you for lazygit, I love it!
Contributor guide
Assessment
This issue has not been assessed yet.