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

Wrong handling of symbolic link in tree view #14623

Open
kuator opened this issue Apr 23, 2024 · 9 comments
Open

Wrong handling of symbolic link in tree view #14623

kuator opened this issue Apr 23, 2024 · 9 comments

Comments

@kuator
Copy link

kuator commented Apr 23, 2024

Steps to reproduce

  1. Download latest vim appimage.
  2. mv Vim-v9.1.0366.glibc2.29-x86_64.AppImage vim
  3. mkdir /tmp/test && mv vim /tmp/test && chmod u+x /tmp/test/vim
  4. cd /tmp/test && mkdir first && echo 'text' >> first/file.txt
  5. ln -sv /tmp/test/first /tmp/test/second
  6. ./vim -c 'let g:netrw_liststyle=3'
  7. Try to open second folder which is a symlink. For some reason netrw added extra second to it's path, and turned it into /tmp/test/second/second, when it should have been /tmp/test/second
Peek.2024-04-23.10-51.mp4

Expected behaviour

Open a symbolic link

Version of Vim

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 14 2024 09:05:11)

Environment

Ubuntu 22.04.4 LTS jammy
GNOME Terminal 3.44.0 using VTE 0.68.0 +BIDI +GNUTLS +ICU +SYSTEMD
xterm-256color
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

Logs and stack traces

No response

@kuator kuator added the bug label Apr 23, 2024
@chrisbra
Copy link
Member

can you try that with a local installation please? I cannot seem to reproduce with latest vim and netrw

@kuator
Copy link
Author

kuator commented Apr 25, 2024

can you try that with a local installation please? I cannot seem to reproduce with latest vim and netrw

I built the latest vim version locally. VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Apr 25 2024 11:57:05). No difference.

Peek.2024-04-25.12-06.mp4

@chrisbra
Copy link
Member

This is 9.1.0? Please try latest master. In particular there was commit 56b7da3 that should have fixed the issue.

@kuator
Copy link
Author

kuator commented Apr 25, 2024

This is 9.1.0? Please try latest master. In particular there was commit 56b7da3 that should have fixed the issue.

I built from latest master: 9.1.369, the vim splash screen in the video above shows 9.1.369 as well

@chrisbra
Copy link
Member

I cannot reproduce this. Here is what I did as a new user:

cb@debian:~$ cat <<'EOF' > .vimrc
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
let g:netrw_liststyle=3
EOF
rm -rf /tmp/test;
mkdir -p /tmp/test &&
echo "first" > /tmp/test/first &&
ln -sfn /tmp/test/first /tmp/test/second

fresh compiled Vim 9.1.373
Can you check with :scriptnames what netrw was loaded?

@chrisbra
Copy link
Member

@kuator
Copy link
Author

kuator commented Apr 26, 2024

I cannot reproduce this. Here is what I did as a new user:

cb@debian:~$ cat <<'EOF' > .vimrc
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
let g:netrw_liststyle=3
EOF
rm -rf /tmp/test;
mkdir -p /tmp/test &&
echo "first" > /tmp/test/first &&
ln -sfn /tmp/test/first /tmp/test/second

fresh compiled Vim 9.1.373 Can you check with :scriptnames what netrw was loaded?

This example also works with my vim install, because in this example second and first are files. But in my original example above, first and second are folders.

@chrisbra
Copy link
Member

with:

drwxr-xr-x 2 chrisbra chrisbra 4096 Apr 30 20:55 first
lrwxrwxrwx 1 chrisbra chrisbra   15 Apr 30 20:49 second -> /tmp/test/first

:Explore /tmp/test

Then selecting second and pressing enter updates the netrw window with the content of /tmpt/test/first (so it follows the symlink) and selecting then a file in the first/ directory opens it just fine for me.

@kuator
Copy link
Author

kuator commented May 2, 2024

with:

drwxr-xr-x 2 chrisbra chrisbra 4096 Apr 30 20:55 first
lrwxrwxrwx 1 chrisbra chrisbra   15 Apr 30 20:49 second -> /tmp/test/first

:Explore /tmp/test

Then selecting second and pressing enter updates the netrw window with the content of /tmpt/test/first (so it follows the symlink) and selecting then a file in the first/ directory opens it just fine for me.

I tried to reproduce this inside of a virtual machine. Ubuntu 24.04, same thing happening, maybe it has something to do with ubuntu? I am gonna try it with other linux systems
VirtualBox_Ubuntu 24 04_02_05_2024_15_48_29

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

No branches or pull requests

3 participants