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

Create symlink @ to selection fails #1345

Closed
9 tasks done
amanjitsk opened this issue Apr 19, 2022 · 4 comments
Closed
9 tasks done

Create symlink @ to selection fails #1345

amanjitsk opened this issue Apr 19, 2022 · 4 comments
Labels

Comments

@amanjitsk
Copy link

Environment details (Put x in the checkbox along with the information)

  • Operating System: Ubuntu 20.04 LTS
  • Desktop Environment: bspwm
  • Terminal Emulator: st/kitty
  • Shell: zsh
  • Custom desktop opener (if applicable): nuke
  • Program options used:
    NNN_SEL=/home/amanjitsk/.config/nnn/selection
    NNN_TRASH=1
    NNN_FIFO=/run/user/1000/nnn.fifo
    NNN_TMPFILE=/home/amanjitsk/.config/nnn/.lastd
    NNN_COLORS=42564256
    NNN_LOCKER=vlock
    NNN_OPTS=cdEfHorQSUx
    NNN_FCOLORS=0B0B04060006060009060B06
    NNN_ARCHIVE=\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$
    NNN_HELP=neofetch
    NNN_OPENER=/home/amanjitsk/.config/nnn/plugins/nuke
    NNN_INCLUDE_HIDDEN=1
  • Configuration options set: NNN_OPTS=cdEfHorQSUx
  • Plugins are installed
  • Issue exists on nnn master

Exact steps to reproduce the issue

  • Select a file/dir that you'd like to create a symlink to
  • Go to some other directory, and attempt to create a symlink to the
    selection with the same name, with the key sequence ns@<Return>s and this fails with the error File exists

This operation should not fail, unless I am attempting to create a symlink in
the same directory with the same name. This used to work before, but now, it
now longer allows to create a symlink with the same name. Trying to create
a symlink to a selected file/dir works if @ is replaced with some other
name, but it is annoying to type out a name, especially when in most cases, I'd like to retain the same name.

Last I checked, the key @ was used to indicate that the symlink name is the
same as the target, unless this has changed now. I also cannot unfortunately
pinpoint exactly which commit this feature broke (this used to work before),
because I have been ignoring this error for quite some time now.

Best,
Amanjit

@amanjitsk amanjitsk added the bug label Apr 19, 2022
@N-R-K
Copy link
Collaborator

N-R-K commented Apr 19, 2022

Duplicate of #1282

@N-R-K N-R-K marked this as a duplicate of #1282 Apr 19, 2022
@amanjitsk
Copy link
Author

Ah, I see. I read through the post, but I still don't understand the rationalize behind why the @ behavior was removed for a single selection. If anything, I thought it would just be a special case. I still think it would be convenient to have that prefix notion for single selection. Anyways, thanks for pointing me to this!

@jarun jarun closed this as completed in 6b9f8f3 Apr 20, 2022
@jarun jarun mentioned this issue Apr 20, 2022
FelixKratz added a commit to FelixKratz/nnn that referenced this issue Apr 20, 2022
* quitcd script for Elvish shell > 0.17.0

* Fix jarun#1345: allow symlink name '@' in single file case

Co-authored-by: SlIdE42 <17254419+SlIdE42@users.noreply.github.com>
Co-authored-by: Arun <engineerarun@gmail.com>
@amanjitsk
Copy link
Author

Thanks, just pulled from master, but I don't know if you misunderstood the intent. Pressing @ on a single selection now creates a symlink with the name @ (I was hoping @ would retain the target name, and not a literal @ name - but at least this commit makes this possible). But I guess I won't re-open the issue as it seems that the decision to get rid of the the prefix notion for a single selection was a deliberate design choice.

@jarun
Copy link
Owner

jarun commented Apr 20, 2022

I was hoping @ would retain the target name, and not a literal @ name

That was never the intention. You have to type the symlink file name when there is a single file selected/for current file.

cgxxv pushed a commit to cgxxv/nnn that referenced this issue May 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants