Skip to content

Aliasing problem on zsh 5.8 #775

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

Closed
seqizz opened this issue Oct 28, 2020 · 6 comments · Fixed by #776
Closed

Aliasing problem on zsh 5.8 #775

seqizz opened this issue Oct 28, 2020 · 6 comments · Fixed by #776
Assignees
Milestone

Comments

@seqizz
Copy link

seqizz commented Oct 28, 2020

Hi there,

First of all, thanks for this plugin, using since forever and it is awesome.

I've just upgraded to zsh 5.8 and my terminal stuck in one case. It looks reproducible:

  • Have tmux installed
  • Have only this block in your .zshrc:
if ! [[ "$TERM" =~  '.*screen.*' ]]
then
    # Notify if there is tmux available
    if tmux ls > /dev/null 2>&1; then
        # reminder
        echo "tmux session available"
    fi
    alias tmux="tmux -u att || tmux -u new-session -s default"
fi
  • Source the plugin.

Afterwards if you want to type tmux it gets stuck once you press x. If I define 2 aliases without ||, it seems to work, but I didn't understand why it didn't like double pipe especially in this case so wanted to report.

Sorry if I am doing something obviously wrong.
Thx

//edit: I've installed with zplug (with defer:2 as instructed), OS is Linux/NixOS.

@phy1729
Copy link
Member

phy1729 commented Oct 28, 2020

Thanks for the bug report. Minimal reproducer: alias foo='foo || foo' then type foo (spins after the second o is typed). Regression from 2ebfa6a.

I think the right fix will be remembering which level each alias was seen at the start of a new command clear all the aliases seen at that level but not higher levels.

phy1729 added a commit to phy1729/zsh-syntax-highlighting that referenced this issue Oct 29, 2020
@phy1729 phy1729 mentioned this issue Oct 29, 2020
@phy1729
Copy link
Member

phy1729 commented Oct 29, 2020

@seqizz could you test and report back if #776 fixes the issue?

@seqizz
Copy link
Author

seqizz commented Oct 29, 2020

@phy1729 yep, looks like working with your branch 👍

@phy1729 phy1729 added this to the 0.8.0 milestone Oct 31, 2020
@phy1729 phy1729 self-assigned this Oct 31, 2020
@abatkin
Copy link

abatkin commented Nov 10, 2020

I can confirm that #776 fixes this issue for me too (another semi-recursive alias)

@danielshahaf
Copy link
Member

@abatkin Thanks for the report 👍

@abatkin
Copy link

abatkin commented Nov 10, 2020

For future generations: Apparently my stock Fedora 33 install included vim-mininal which includes an /etc/profile.d/vim.sh that aliases vim to something crazy if vim-enhanced is not also installed (it's trying to detect if it should be using a "real" vi or vim, who knows what they are trying to accomplish). This meant that (together with whatever local customization I have - I use oh-my-zsh together with other personal cruft that I've accumulated over many years) every time I typed vi or vim and hit space or enter, vim would hang and consume 100% CPU.

This is fixed by any of the following:

  • Merge Alias fix #776
  • Install vim-enhanced
  • Install vim-enhanced and remove vim-mininal

Keywords for better Google-fu: fedora running vi and vim hangs with zsh

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

Successfully merging a pull request may close this issue.

4 participants