Skip to content

Unset aliases to prevent syntax errors or unintended behaviour #720

@HaleTom

Description

@HaleTom

Update

I found the culprit:

I have the following config:

alias -g EO='2>&1'
alias -g EOF='2>&1 >'

EOF is used here:

command cat >! "${plugin:t}.plugin.zsh" <<EOF

What happened?

% zi update
/home/ravi/.local/share/zinit/zinit.git/zinit-autoload.zsh:1273: parse error near `>&'
% awk  'NR>=1271 && NR<=1276 {print NR, $0}' /home/ravi/.local/share/zinit/zinit.git/zinit-autoload.zsh
1271     local year="${$(command date "+%Y"):-2020}"
1272
1273     command cat >! "${plugin:t}.plugin.zsh" <<EOF
1274 # -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
1275
1276 # Copyright (c) $year $user_name
%

Steps to reproduce

  1. Run zinit update

Relevant output

/home/ravi/.local/share/zinit/zinit.git/zinit-autoload.zsh:1273: parse error near `>&'

Screenshots and recordings

No response

Operating System & Version

OS: linux-gnu | Vendor: pc | Machine: x86_64 | CPU: x86_64 | Processor: unknown | Hardware: x86_64

Zsh version

zsh 5.9 (x86_64-pc-linux-gnu)

Terminal emulator

tmux-256color

If using WSL on Windows, which version of WSL

None

Additional context

I can't understand what zsh is trying to say here.

There's no >& on line 1273:

    command cat >! "${plugin:t}.plugin.zsh" <<EOF

How would I go about debugging this?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions