Prezto: Safe-ops aliases broken

Created on 25 Mar 2019  ยท  4Comments  ยท  Source: sorin-ionescu/prezto

Description

With zstyle ':prezto:module:utility' safe-ops 'yes' (the default) the safe-ops aliases such as rmi, mvi, cpi, and lni don't work. This isn't very noticeable because with safe-ops set to 'yes' you would normally use the aliased rm, mv, cp, and ln which become the safe versions as expected and work fine.

It looks to me like it's a recursive alias issue where rmi is aliased to rm -i and rm is aliased to rmi. Why this causes issues for rmi but not rm in unclear to me. The easiest fix looks to me to be changing each of the safe-ops aliases from

alias rm='rmi'
alias mv='mvi'
alias cp='cpi'
alias ln='lni'

to

alias rm='$aliases[rmi]'
alias mv='$aliases[mvi]'
alias cp='$aliases[cp]i'
alias ln='$aliases[lni]'

Expected behavior

user@host:~$ rmi
rm: missing operand
Try 'rm --help' for more information.

Actual behavior

user@host:~$ rmi
zsh: command not found: rmi

Steps to Reproduce

  1. Set up a clean zprezto directory as described in in CONTRIBUTING.md
  2. rmi

Versions

  • Prezto commit: 1f4601e
  • ZSH version: zsh 5.6.2 (x86_64-redhat-linux-gnu)
  • OS information: Fedora release 29 (Twenty Nine)

Most helpful comment

Should be resolved now. Please let me know if you have any more issues! Sorry it took so long to get a fix in.

All 4 comments

+1 for a fix please

This is very noticeable with the highlighter plugin enabled.
It'll highlight commands like ln, cp red (without the i suffix)

I'm not sure what's going on here:

~/.antigen/bu/s/prezto master ?1 โฏ echo $aliases[rm]
rmi
~/.antigen/bu/s/prezto master ?1 โฏ echo $aliases[rmi]
nocorrect rm -i

However, you're right that it doesn't work. I'll take a look.

Should be resolved now. Please let me know if you have any more issues! Sorry it took so long to get a fix in.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiqua picture hiqua  ยท  6Comments

voanhduy1512 picture voanhduy1512  ยท  3Comments

belak picture belak  ยท  4Comments

michaelaye picture michaelaye  ยท  4Comments

wiesson picture wiesson  ยท  5Comments