Zsh produces escape sequences as they were actual strings. #10632

Closed
opened 2026-01-31 02:26:09 +00:00 by claunia · 10 comments
Owner

Originally created by @skyline75489 on GitHub (Sep 15, 2020).

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]  10.0.19041.508]
Windows Terminal version (if applicable):  1.2.2381.0

Any other software?

Steps to reproduce

I'm using Ubuntu(WSL 2.0) and try to use zsh through bash.

Expected behavior

It works.

Actual behavior

image

I think there is another similar issue like this but I can not find it..

Originally created by @skyline75489 on GitHub (Sep 15, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] 10.0.19041.508] Windows Terminal version (if applicable): 1.2.2381.0 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> I'm using Ubuntu(WSL 2.0) and try to use `zsh` through `bash`. # Expected behavior It works. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior ![image](https://user-images.githubusercontent.com/4710575/93212929-d55c3880-f795-11ea-97c4-21cc9d67df1b.png) I think there is another similar issue like this but I can not find it.. <!-- What's actually happening? -->
Author
Owner

@jdebp commented on GitHub (Sep 15, 2020):

If you are thinking of issues #7091 and #6634 note that the output processing differs and that they aren't running on WSL.

@jdebp commented on GitHub (Sep 15, 2020): If you are thinking of issues #7091 and #6634 note that the output processing differs and that they aren't running on WSL.
Author
Owner

@DHowett commented on GitHub (Sep 15, 2020):

This doesn't look like the stock zsh configuration. Can you share your zshrc?

@DHowett commented on GitHub (Sep 15, 2020): This doesn't look like the stock zsh configuration. Can you share your zshrc?
Author
Owner

@skyline75489 commented on GitHub (Sep 16, 2020):

Yes I'm using a custom zshrc and the PROMPT is here https://github.com/skyline75489/mydotfiles/blob/master/.zshrc#L41

This also happens with conhost. What interests me is that, in the OpenSUSE WSL distro which I mainly use, the issue does not exist. Be it zsh on bash, bash on bash, you name it. It all works. But in the Ubuntu WSL2 distro it collapses for some reason.

When I'm finished with the OSC things I'll see if I can find out why.

@skyline75489 commented on GitHub (Sep 16, 2020): Yes I'm using a custom zshrc and the PROMPT is here https://github.com/skyline75489/mydotfiles/blob/master/.zshrc#L41 This also happens with conhost. What interests me is that, in the OpenSUSE WSL distro which I mainly use, the issue does not exist. Be it zsh on bash, bash on bash, you name it. It all works. But in the Ubuntu WSL2 distro it collapses for some reason. When I'm finished with the OSC things I'll see if I can find out why.
Author
Owner

@skyline75489 commented on GitHub (Sep 16, 2020):

Now that I think about it, it may be just my zshrc is broken since it contains invisible characters. Maybe just a false alarm.

@skyline75489 commented on GitHub (Sep 16, 2020): Now that I think about it, it may be just my zshrc is broken since it contains invisible characters. Maybe just a false alarm.
Author
Owner

@skyline75489 commented on GitHub (Sep 16, 2020):

OK I can confirm it's a false alarm. Something happens to my local zshrc file. It no longer contains actual \e escape codes any more..

@skyline75489 commented on GitHub (Sep 16, 2020): OK I can confirm it's a false alarm. Something happens to my local zshrc file. It no longer contains actual `\e` escape codes any more..
Author
Owner

@DHowett commented on GitHub (Sep 16, 2020):

Weird!

@DHowett commented on GitHub (Sep 16, 2020): Weird!
Author
Owner

@skyline75489 commented on GitHub (Sep 17, 2020):

Maybe it's just me doing some copy-paste thing that ruined the zshrc in the past but I didn't realize that. Never mind. Still a false alarm.

@skyline75489 commented on GitHub (Sep 17, 2020): Maybe it's just me doing some copy-paste thing that ruined the zshrc in the past but I didn't realize that. Never mind. Still a false alarm.
Author
Owner

@jdebp commented on GitHub (Sep 20, 2020):

It's a lot easier to instead use the Z shell's built-in mechanisms for coloured prompts, e.g. %F{green}, %B, %b, and %K{254}. One does not have to calculate or hardware any control sequences at all, and this problem does not occur.

@jdebp commented on GitHub (Sep 20, 2020): It's a lot easier to instead use the Z shell's built-in mechanisms for coloured prompts, e.g. `%F{green}`, `%B`, `%b`, and `%K{254}`. One does not have to calculate or hardware any control sequences at all, and this problem does not occur.
Author
Owner

@trajano commented on GitHub (Feb 2, 2021):

@skyline75489 are you using zsh from Windows like git-bash or WSL2?

@trajano commented on GitHub (Feb 2, 2021): @skyline75489 are you using zsh from Windows like git-bash or WSL2?
Author
Owner

@zadjii-msft commented on GitHub (Feb 2, 2021):

He was using WSL; his .zshrc was corrupted.

@zadjii-msft commented on GitHub (Feb 2, 2021): He was using WSL; his `.zshrc` was corrupted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10632