Skip to content

Shell freezes after cat .zshrc | table #6594

Closed

Description

@cassis163

Describe the bug

I wanted to give this shell a try with some useless commands. cat .zshrc | table crashed my entire shell.

How to reproduce

Run cat .zshrc | table, where my .zshrc file has the following contents:

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled  # disable automatic updates
# zstyle ':omz:update' mode auto      # update automatically without asking
# zstyle ':omz:update' mode reminder  # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
	git
	zsh-autosuggestions
	sudo
	web-search
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

export PYTHONPATH="/usr/bin/python3"
export PATH=$HOME/.local/bin:$PATH

alias vim="nvim "
alias code="codium "
alias pop-os-update-all="sudo nala update && sudo nala upgrade && sudo nala autoremove && flatpak update"
alias arch-update-all="sudo pacman -Sy && paru -Sua && flatpak update && sudo snap refresh"

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Expected behavior

I expected to quickly see a table pop up with the line numbers and line contents as columns. Though, I am new to this shell and maybe the table should have looked completely different than what I am describing. Anyway, I did not expect my shell to freeze to death.

Screenshots

No response

Configuration

key value
version 0.68.1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.63.0 (4b91a6ea7 2022-08-08)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.63.0 (fd9c4297c 2022-07-01)
pkg_version 0.68.1
build_time 2022-09-20 21:52:29 +02:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. changed the title [-]Freezes after `cat .zshrc | table`[/-] [+]Shell freezes after `cat .zshrc | table`[/+] on Sep 20, 2022
  2. cassis163 commented on Sep 21, 2022

    @cassis163
    Author

    This command probably makes no sense, but I cannot end the process with a keyboard interrupt. This is really annoying and feels a bit unstable.

    By the way, this is an awesome project. I'm still quite impressed by the readable errors.

  3. sholderbach commented on Sep 21, 2022

    @sholderbach
    Member

    Can reproduce the hanging. At first I thought this was related to the external command pipeline bugs we saw with #6273, but there seems to be a separate issue, because it also occurs with the development branch were this has been reverted.

  4. added
    category:bug
    A:external-commands
    on Sep 21, 2022
  5. sholderbach commented on Sep 21, 2022

    @sholderbach
    Member

    Interesting:

    open -r ~/.zshrc | lines | table
    
    cat ~/.zshrc | lines | table

    both work fine. And doing open -r ~/.zshrc | table produces not tablified output just fine.

  6. nibon7 commented on Sep 21, 2022

    @nibon7
    Contributor

    Seems channel issue introduced by 91e17d2, I reverted it, and it doesn't hang again.

    Related #5625

  7. WindSoilder commented on Sep 24, 2022

    @WindSoilder
    Contributor

    I can reproduct the issue

    Seems channel issue introduced by 91e17d2, I reverted it, and it doesn't hang again.

    I confirm it doesn't hang again either

  8. added this to the v0.70.0 milestone on Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:external-commandscategory:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions