Skip to content

[bug]: double letters after subshell #44

Description

@Arusekk

Environment

OSTYPE=linux-gnu CPUTYPE=x86_64 / MACHINE_TYPE=x86_64 ZSH_VERSION=5.9

Expected behavior

When I write:

(cd ../dir; git diff)|patch -p1 

I expect the command to appear the same as I write.

Current behavior

(cd ../dir; git diff))||ppaattcchh  --pp11 

Steps to reproduce

install in oh-my-zsh custom like README says

Code snippet

My .zshrc:

Details
if [[ -z "$DISPLAY" ]] && [[ "$(tty)" == /dev/tty3 ]]; then
  exec startx
fi

cat ~/.cache/neofetch
neofetch > ~/.cache/neofetch &|

# 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

( [[ "$XDG_CURRENT_DESKTOP" == kde ]] || [[ "$XDG_CURRENT_DESKTOP" == KDE ]] ) && unset QT_QPA_PLATFORMTHEME

autoload -U compinit promptinit
compinit
promptinit; prompt gentoo

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$HOME/bin:$HOME/.local/bin:$PATH:/sbin
export TERMINAL="$HOME/bin/kkonsole"
export JAVA_OPTS=-Dawt.useSystemAAFontSettings=lcd
export JAVA_TOOL_OPTIONS="$JAVA_OPTS"

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

# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell"
# ZSH_THEME="powerline"
# ZSH_THEME="bullet-train"
# ZSH_THEME="agnoster"
ZSH_THEME="powerlevel10k/powerlevel10k"
DEFAULT_USER="arusekk"

HYPHEN_INSENSITIVE="true"
# COMPLETION_WAITING_DOTS="true"
# /!\ do not use with zsh-autosuggestions

plugins=(tig gitfast colored-man-pages colorize command-not-found cp dirhistory docker autojump sudo F-Sy-H zsh-autosuggestions)
# /!\ zsh-syntax-highlighting and then zsh-autosuggestions must be at the end

if [[ -z "$MC_SID" ]]; then # don't use omz with midnight commander
  source $ZSH/oh-my-zsh.sh
  __p9k_vcs_states[CLEAN]="236"
  __p9k_vcs_states[UNTRACKED]="236"
fi

# 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"

# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"

# 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"

rule () {
	print -Pn '%F{blue}'
	local columns=$(tput cols)
	for ((i=1; i<=columns; i++)); do
	   printf "\u2588"
	done
	print -P '%f'
}

function _my_clear() {
	echo
	rule
	zle clear-screen
}
zle -N _my_clear
bindkey '^l' _my_clear

# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
  OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
  zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}

pastefinish() {
  zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish

. ~/.aliases

if [[ $PPID -eq $KATE_PID ]]; then
  export EDITOR='kate -b'
  export VISUAL='kate -b'
fi

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

# bun completions
[ -s "/home/arusekk/.bun/_bun" ] && source "/home/arusekk/.bun/_bun"

# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"

Aditional information

This is probably a longstanding bug with parsing git commands, since I had a very old version of everything and updating everything did not help.

Self-service

  • I'd be willing to address this documentation request myself.

Have you read the Contributing Guidelines?

Are you familiar with Contributor Covenant Code of Conduct?

Contact Details

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions