vscode-open-in-vim
vscode-open-in-vim copied to clipboard
Doesn't seem to work with Linux Snap package
Hi,
I really like your extension, and I use it to open a file in Gvim:
"open-in-vim.openMethod": "gvim"
but there seems to be a problem with the vscode installed throught snap on Ubuntu 18.10. When I select the command "Open in Vim", nothing happens.
Do you know why that's happening, and if it can be solved?
Thank you
Hm. I'd expect it to at least display an error message if something goes wrong. Does it work for other open methods, like integrated-terminal
?
Also, is it perhaps an unnofficial/old snap of vscode? I saw a blurb about migrating vscode snaps:
Microsoft is now publishing an official snap of Visual Studio Code, you should migrate to it using these commands:
snap remove vscode snap install code --classic
(https://snapcraft.io/vscode)
@jonsmithers Yes, it works with integrated-terminal
, and also I'm using the official snap package.
I guess it could be due to a permission issue or something because of how snap packages are in a sandbox, but that's just a guess.
I tried in another system (a VirtualBox guest) with the same configuration as the other system, and I saw this error message; maybe it would be helpful:
That's really interesting. I'm travelling at the moment and have really spotty internet, so it might be a few days before I can try the snap for myself.
Presumably running gvim path/to/file "+call cursor(1, 2)"
by itself from the terminal works fine.
It's OK. Take a look whenever you have time.
Also, I'm not sure if I'm missing something here, but when I run the command you mentioned, I get an error, and the terminal ends up showing vim in terminal and not Gvim, this is what I see:
Oh wow. That seems to suggest that this is an issue with gvim. I have some ideas for random things to try:
- If you just run
gvim my-packages.txt
(without"+call cursor(1, 2)"
), it runs normally, right?- If so, try running
gvim my-packages.txt -c "call cursor(1, 2)"
to see if it's any different? This is supposed to be equivalent togvim my-packages.txt "+call cursor(1, 2)"
.
- If so, try running
- Can you repeat the crash in a normal Terminal application, outside of vscode? (maybe it's a snap permission issue like you said)
- What does
gvim --version | head -n 2
say? I have version 8.1, with included patches 1-956, and it doesn't crash. If yours is more recent, maybe we should look into making a bug report with vim.
(As a side note, it would be nice if this open-in-vim
plugin detected non-zero exits so that an issue like this doesn't unfold as a silent failure.)
Sorry @jonsmithers for the late reply, I tried a few things you suggested and:
-
Running
gvim my-packages.txt
in VSCode terminal: -
Running
gvim my-packages.txt -c "call cursor(1, 2)"
: -
Of course in normal terminal, it's totally fine and running
gvim my-packages.txt
opens Gvim -
Getting the version:
Any ideas?
Thanks for helping with all this experimentation. I feel fairly confident you are right about this being a snap permission issue. I was able to finally install the snap on Fedora and I can reproduce the issue myself too. I think the best place for further investigation is on vscode's side. I went ahead and made an issue there. Feel free to add anything I might have missed.
Thank you @jonsmithers for creating that issue; let's see what happens there :)