-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
support open file and link on WSL #1997
Conversation
) | ||
|
||
func isWSL() bool { | ||
data, err := ioutil.ReadFile("/proc/sys/kernel/osrelease") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shinhs0506 is this a large file? I wanna get an idea of the cost of reading it at startup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is one line long
just as a reference, microsoft/WSL#423 (comment)
my /proc/sys/kernel/osrelease
has the following content
5.10.102.1-microsoft-standard-WSL2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question :) marking as changes requested for my own bookkeeping
@shinhs0506 looks like you've gotta run gofumpt on |
Nice work @shinhs0506 ! |
should also fix #1513 |
Sorry to add to this, but I think there should be proper handling of setups where The error below appears on WSL2 using wezterm and (ctrl) clicking on links to try opening them in the default browser. lazygit crashes because of 2024/09/03 12:33:31 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues
*errors.errorString bash: line 1: xdg-open: command not found
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:200 (0x9777db)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:107 (0x97682c)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:45 (0x975ea5)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj.go:190 (0x97506f)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/os.go:110 (0x979e77)
/home/runner/work/lazygit/lazygit/pkg/gui/information_panel.go:44 (0xaf41c6)
/home/runner/work/lazygit/lazygit/pkg/gui/keybindings.go:387 (0xaf810f)
/home/runner/work/lazygit/lazygit/pkg/gui/keybindings.go:373 (0xaf803b)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1424 (0x760fd9)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1392 (0x760e71)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1300 (0x760671)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:798 (0x75ea0a)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:752 (0x75e58b)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:739 (0x75e2a5)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:669 (0xaf0885)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:675 (0xaf0dac)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:108 (0x82b2c7)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:674 (0xaf0cf4)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:263 (0xb1afe9)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:48 (0xb1af7e)
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:150 (0xb1d286)
/home/runner/work/lazygit/lazygit/main.go:23 (0xb1eb1e)
/opt/hostedtoolcache/go/1.20.7/x64/src/runtime/internal/atomic/types.go:194 (0x437c87)
/opt/hostedtoolcache/go/1.20.7/x64/src/runtime/asm_amd64.s:1598 (0x467ec1) A solution for this case may be to fallback to A few additions: it seems that this control somehow does not work. Also, Edited to add info about code. |
|
But generally, I agree that this PR is nonsense and should be reversed. The true motivation of the author of this PR is apparently clear only to himself, in which case he can set himself a fork with this change instead of making these destructive changes in the master
Even tho ❯ whoami
loli
❯ xdg-open . | ps -aux | grep xdg-open
loli 14921 0.0 0.0 2616 1748 pts/9 S+ 06:18 0:00 /bin/sh /usr/bin/xdg-open . To sum up: PR has done more harm than good, at least because most of everyone I know uses xdg-open along with WSL2, and now at least @pirafrank and me should have to use fix for this "fix" At least those who vitally need to use open via @jesseduffield Would you and you be so kind as to consider this matter? |
I agree with the comment above. Also, I think this pkg may help https://github.com/cli/browser. Customizing the |
fixes #1996