vim / vim-appimage

AppImage for gVim
115 stars 20 forks source link

Current working directory not correctly set when running inside Docker Container/FUSEless system #51

Closed stablestud closed 1 year ago

stablestud commented 1 year ago

Dear maintainer(s),

When running the Vm AppImage inside a Docker container, the current working directory is replaced with AppImages internal path. Breaking relative file paths when used as arguments with Vim.

Docker supports no Fuse so the AppImage must be run with --appimage-extract-and-run which extracts the AppImage and runs it. This works fine so far except that the CWD where Vim was called from is not kept and is changed to the extracted AppImage dir.

Having this setup:

root@763fe0d67d0c:~# ls
Vim-v9.0.1833.glibc2.29-x86_64.AppImage  file.txt

root@763fe0d67d0c:~# pwd
/root

# Now running Vim AppImage
root@763fe0d67d0c:~# ./Vim-v9.0.1833.glibc2.29-x86_64.AppImage --appimage-extract-and-run ./file.txt

Now when executing Vim :pwd returns /tmp/appimage_extracted_0d7da17d27cad8d507bf02564b76c922/usr and not the expected /root This leads to the file ./file.txt not being found, making editing with Vim inside a container hard to use as all relative paths are non working.

Looking into vim.start.sh it seems that the cd'ing back into $OWD is trying to fix that, but in my testing it was always unset.

Strangely with nvim and tmux AppImages it worked fine without any issues, they both seem to have completely different startup procedure.

For reference:

Vim AppImage is extremely useful for debugging (inside) Docker containers, so this would be very nice if it could be fixed.

Thank you for your effort :)

chrisbra commented 1 year ago

Thanks for letting me know. Both of the example projects seem to make use of linuxdeploy. I also heard of a different (security relevant) issue which makes me think I'll need to switch to linuxdeploy as well. Hopefully this will work better than.

chrisbra commented 1 year ago

can you please verify with the latest version?

stablestud commented 1 year ago

Problem is fixed and its works now as expected! :+1: Thank you :smile: