Skip to content
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

Bug: pure + iterm2 + iterm2 plugin + iterm2 shell integration breaks Cmd-K (Clear Buffer) #680

Open
3 tasks done
jamesdh opened this issue Jun 1, 2024 · 2 comments
Open
3 tasks done

Comments

@jamesdh
Copy link

jamesdh commented Jun 1, 2024

General information

When using pure w/ iterm2, the iterm2 zsh plugin, and the plugins ability to enable the iterm2 shell integration, the shortcut for clearing the terminal (Cmd-K) is broken, and instead exhibits inconsistent but broken behavior. Sometimes it fixes the cursor to the bottom of the terminal. Sometimes it simply does nothing. Sometimes it will correctly clear the screen. Pressing Ctrl-L restores it to the top of the terminal.

System report (output of prompt_pure_system_report):

  • Zsh: zsh 5.9 (x86_64-apple-darwin23.0) (/bin/zsh)
  • Operating system: macOS 14.5 (23F79)
  • Terminal program: iTerm.app (3.4.23)
  • Tmux: no
  • Git: git version 2.39.3 (Apple Git-146)
  • Pure state:
    • username: ''
    • prompt:
    • version: 1.23.0
  • zsh-async version: 1.8.6
  • PROMPT: typeset -g PROMPT=$'%F{${prompt_pure_colors[path]}}%~%f %{ %}%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f %{�]133;B�%}'
  • Colors: typeset -g -A prompt_pure_colors=( [execution_time]=yellow [git:action]=yellow [git:arrow]=cyan [git:branch]=242 [git:branch:cached]=red [git:dirty]=218 [git:stash]=cyan [host]=242 [path]=blue [prompt:continuation]=242 [prompt:error]=red [prompt:success]=magenta [suspended_jobs]=red [user]=242 [user:root]=default [virtualenv]=242 )
  • TERM: export TERM=xterm-256color
  • Virtualenv: export VIRTUAL_ENV_DISABLE_PROMPT=12
  • Conda: export CONDA_CHANGEPS1=no
  • Detected frameworks: Oh My Zsh
    • Oh My Zsh:
      • Plugins: brew, direnv, gcloud, gradle, iterm2, nvm, pyenv, sdk

Other information

  • I've duplicated this across two separate machines.
  • Cmd-K does work correctly in the macOS default Terminal app.
  • Tried multiple other themes and was unable to reproduce this issue with others.

I have:

  • Tested with another terminal program and can reproduce the issue
    • Am unable to reproduce this in macOS Terminal app
  • Tested the same combination above but with multiple other themes and am unable to reproduce the issue
  • Followed the integration instructions for my framework

Problem description

iTerm2 native shortcut to clear the terminal buffer is broken by combination of pure theme, iterm2 zsh plugin, and enabling shell integration via said plugin.

Reproduction steps

  1. Add iTerm2 plugin, e.g. plugins=(iterm2...)
  2. Enable iTerm2 shell integration via plugin, e.g. zstyle :omz:plugins:iterm2 shell-integration yes
  3. Open iTerm2
  4. Perform any generic command to generate output
  5. Press Cmd-K
  6. Potentially repeat once or twice and you should see the unexpected behavior.

My .zshrc:

ZSH_THEME=""
export ZSH="$HOME/.oh-my-zsh"
zstyle :omz:plugins:iterm2 shell-integration yes
plugins=(iterm2)
fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
autoload -U promptinit; promptinit
prompt pure
source $ZSH/oh-my-zsh.sh
@mafredri
Copy link
Collaborator

mafredri commented Jun 1, 2024

I can't reproduce this behavior with iTerm2 shell integration and Pure (without OMZ).

Could you try swapping the order there at the end?

source $ZSH/oh-my-zsh.sh

autoload -U promptinit; promptinit
prompt pure

@jamesdh
Copy link
Author

jamesdh commented Jun 3, 2024

@mafredri that actually appears to have fixed it for me. What made you think to suggest that?

EDIT: nevermind...I see your and Pure (without OMZ). comment above!

jamesdh added a commit to jamesdh/dotfiles that referenced this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants