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

Mysterious ←[?1h character appears when typing on Windows #12376

Closed
edmundito opened this issue Apr 22, 2024 · 9 comments
Closed

Mysterious ←[?1h character appears when typing on Windows #12376

edmundito opened this issue Apr 22, 2024 · 9 comments
Assignees
Labels
Platform: Windows Issue or PR for Windows Resolution: not our issue Issue or pull request not related to Oh My Zsh

Comments

@edmundito
Copy link

Describe the bug

The characters ←[?1h appears whenever I type in my Windows terminal. It does not impact entering commands but it's annoying. This only started in recent weeks without many changes other than Windows update, OMZ updates.

Similarly described in zsh-users/zsh-autosuggestions#614 but I do not have the zsh-autosuggestions plugin installed (unless it's been integrated into omz directly?)

Steps to reproduce

  1. Setup git bash with zsh and omz
  2. Open git bash
  3. Type

Expected behavior

Nothing should appear

Screenshots and recordings

image

OS / Linux distribution

Windows 10

Zsh version

5.9

Terminal emulator

Windows Terminal, Cmd, Git Bash

If using WSL on Windows, which version of WSL

None

Additional context

No response

@Jouramie
Copy link

Jouramie commented Apr 23, 2024

I have the same issue, it started just after updating omz. Running zsh -df as suggested in the issue you linked does stop the ←[?1h from appearing on my side. However, I doubt zsh-autosuggestions is the issue, since disabling it does not solve anything.

I only see the issue in the integrated terminal of PyCharm and VS Code, when launching Git Bash setup with ZSH and OMZ. Git Bash opened as standalone does not have the issue. Running Windows 11.

@carlosala
Copy link
Member

If you follow the steps mentioned here #12328 (comment), does it fix the issues for you?

@carlosala carlosala self-assigned this Apr 23, 2024
@edmundito
Copy link
Author

If you follow the steps mentioned here #12328 (comment), does it fix the issues for you?

@carlosala It does not.

Running zsh -df as suggested in the issue you linked does stop the ←[?1h from appearing on my side. However, I doubt zsh-autosuggestions is the issue, since disabling it does not solve anything.

@Jouramie running zsh without the rcs is fine.

I found a workaround:

  1. Comment out source ./...ohmzsh.sh script in .zshrc
  2. Open new termina
  3. Remove the comment and re-run source ./.zshrc

The prompt now works with omz correctly and does not show the issue. 🤔

@carlosala
Copy link
Member

carlosala commented Apr 23, 2024

You shouldn't source zshrc, in order to re-run a shell you can use exec zsh or omz update. @mcornella do you know why it could appear?

@mcornella
Copy link
Member

If this is fixed by loading OMZ last it must be that some bad setting is getting overriden. Perhaps it might be related to stty settings backed up in check_for_upgrade.sh 1? Try disabling the auto update with

zstyle ':omz:update' mode disabled

to see if that bypasses the issue (which would confirm that 1 is related) and also please post your .zshrc file that reproduces this.

@mcornella mcornella added Status: not reproducible Issue is not reproducible Platform: Windows Issue or PR for Windows labels Apr 27, 2024
@edmundito
Copy link
Author

@mcornella This did not make any difference.

Here's my .zshrc, nothing too interesting. I was trying to also disable the git autosuggest to see if that was the problem:

export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="simple"
plugins=(git)

source $ZSH/oh-my-zsh.sh

unset ZSH_AUTOSUGGEST_USE_ASYNC
zstyle ':omz:alpha:lib:git' async-prompt no
zstyle ':omz:update' mode disabled

@carlosala carlosala assigned mcornella and unassigned carlosala May 1, 2024
@edmundito
Copy link
Author

Hmm, I just found something that may have fixed the issue. I have an a lazy setup because I seldom use Windows and I'm running zsh through Git Bash and followed this setup: https://dominikrys.com/posts/zsh-in-git-bash-on-windows/

I just updated git for Windows and the problem is gone.

@carlosala
Copy link
Member

That makes it a not-our-issue situation! Thanks for the debugging!

@carlosala carlosala closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
@carlosala carlosala added Resolution: not our issue Issue or pull request not related to Oh My Zsh and removed Status: not reproducible Issue is not reproducible labels May 1, 2024
@mcornella
Copy link
Member

Thanks for posting the solution Edmundo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Windows Issue or PR for Windows Resolution: not our issue Issue or pull request not related to Oh My Zsh
Projects
Status: Done
Development

No branches or pull requests

4 participants