Skip to content
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

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

Closed
stablestud opened this issue Sep 4, 2023 · 3 comments

Comments

@stablestud
Copy link

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
Copy link
Member

chrisbra commented Sep 6, 2023

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 added a commit to chrisbra/vim-appimage-1 that referenced this issue Sep 6, 2023
This uses the linuxdeploy script and simplifies the creation of Appimage
greatly.

It also hopefully fixes two issues: vim#51 and possibly a security relevant
one, mentioned on huntr.

Let's test
chrisbra added a commit to chrisbra/vim-appimage-1 that referenced this issue Sep 6, 2023
This uses the linuxdeploy script and simplifies the creation of Appimage
greatly.

It also hopefully fixes two issues: vim#51 and possibly a security relevant
one, mentioned on huntr.

Let's test
chrisbra added a commit to chrisbra/vim-appimage-1 that referenced this issue Sep 6, 2023
This uses the linuxdeploy script and simplifies the creation of Appimage
greatly.

It also hopefully fixes two issues: vim#51 and possibly a security relevant
one, mentioned on huntr.

Let's test
@chrisbra
Copy link
Member

chrisbra commented Sep 6, 2023

can you please verify with the latest version?

@stablestud
Copy link
Author

Problem is fixed and its works now as expected! 👍 Thank you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants