wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.28k stars 781 forks source link

Spurious indents when using Zinit #822

Closed poetaman closed 3 years ago

poetaman commented 3 years ago

Describe the bug

Running >>git status -uno in a git repo from WezTerm using zsh & zinit produces spurious indents on each line. This problem does not happen with iTerm2. Not sure if this is a zinit issue, have posted this as a bug on their repo too: https://github.com/zdharma/zinit/issues/514

Environment (please complete the following information):

To Reproduce

1) Install zinit. It will add following lines to your .zshrc:

### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
    print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
    command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
    command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
        print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
        print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi

source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
    zinit-zsh/z-a-rust \
    zinit-zsh/z-a-as-monitor \
    zinit-zsh/z-a-patch-dl \
    zinit-zsh/z-a-bin-gem-node

### End of Zinit's installer chunk

2) Manually add few more lines after these lines:

# Two regular plugins loaded without investigating.
zinit light zsh-users/zsh-autosuggestions
zinit light zdharma/fast-syntax-highlighting

# Plugin history-search-multi-word loaded with investigating.
zinit load zdharma/history-search-multi-word

# Load the pure theme, with zsh-async library that's bundled with it.
zinit ice pick"async.zsh" src"pure.zsh"
zinit light sindresorhus/pure
  1. Open new tab, cd to a git repo, and run >>git status -uno

Screenshots

Screen Shot 2021-05-25 at 2 09 36 AM

poetaman commented 3 years ago

Nevermind, this does not always happen. Not sure why it happened then...

wez commented 3 years ago

Looks like something is changing the stty ocrnl or other output settings which impacts how CR is processed at the kernel level.

Most likely something in your shell setup is manipulating stty. https://github.com/zdharma/zinit/search?q=stty shows that zinit does something with stty but I don't really want to learn what zinit is or does :)

I'd suggest reading through issues like this one: https://github.com/containers/podman/issues/3179 to get a sense of what is happening.

You'll also want to look at man stty and stty -a to see what mode the tty is in.

wez commented 3 years ago

I'm closing this out as it doesn't appear to be a wezterm issue, but an issue with the tty settings.

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.