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

ANSI codes inserted into the prompt after starting broot (causing "No matching verb") #854

Closed
Gelio opened this issue Mar 10, 2024 · 15 comments
Labels
bug Something isn't working Mac

Comments

@Gelio
Copy link

Gelio commented Mar 10, 2024

After starting br or broot in my terminal, I see the following ANSI codes inserted immediately:

image

It says: 11;rgb:2828/2a2a/3636

This happens regardless of whether I run the command in zsh, bash (with the default bash prompt), inside or outside tmux.

The only difference is that when I run it outside tmux, broot does not say "No matching verbs", but it behaves as if the sequence was not there:

image

I am not sure what is causing this. I would appreciate any tips to debug this issue.

@Gelio Gelio added the bug Something isn't working label Mar 10, 2024
@Canop
Copy link
Owner

Canop commented Mar 10, 2024

This is related to the test of terminal colors.

Assuming you're using version 1.36 of broot, can you please see if it happens for you with version 1.32 ?

@Gelio
Copy link
Author

Gelio commented Mar 10, 2024

You are right, this problem does not occur on 1.32.0

Kapture.2024-03-10.at.12.00.19.mp4

For reference, I am using kitty 0.32.2

@Canop
Copy link
Owner

Canop commented Mar 10, 2024

@Gelio I don't know if you're able to compile things for rust.

If so, I would appreciate if you could test the example of https://github.com/Canop/xterm-query/ which is executed with cargo run --example kitty

@Gelio
Copy link
Author

Gelio commented Mar 10, 2024

I understand you wanted me to run cargo run --example kitty from that repo.

Here is the output in kitty in tmux:

image

Here is the output in kitty outside of tmux:

image

The extra codes in my prompt were inserted automatically. The screenshots contain the state right after the command finished

@Canop
Copy link
Owner

Canop commented Mar 10, 2024

What's your terminal and OS exactly ?

@zeenix
Copy link

zeenix commented Mar 10, 2024

Strange. Ironically my commit in xterm-query introducing this issue is exactly the solution to the symptoms here (at least on Linux) that I reported in Canop/terminal-light#4.

@Gelio
Copy link
Author

Gelio commented Mar 10, 2024

What's your terminal and OS exactly ?

Terminal: kitty 0.32.2

OS: macOS Sonoma 14.2.1

@Gelio
Copy link
Author

Gelio commented Mar 10, 2024

Here is the output from macOS default terminal app:

image image

@zeenix
Copy link

zeenix commented Mar 10, 2024

@Gelio Thanks for providing the example run. I was about to reproduce this issue. I think Canop/xterm-query#4 fixes this since I'm not able to reproduce the issue when using the branch of that PR.

@zeenix
Copy link

zeenix commented Mar 10, 2024

@Gelio just out of curiosity, was broot working fine on Mac before recently?

@Gelio
Copy link
Author

Gelio commented Mar 10, 2024

@Gelio Thanks for providing the example run. I was about to reproduce this issue. I think Canop/xterm-query#4 fixes this since I'm not able to reproduce the issue when using the branch of that PR.

I checked out that commit and it looks like the problem is fixed for me on kitty

Kitty in tmux:

image

Kitty outside of tmux (says image protocol is supported, as expected):

image

Interestingly, the macOS Terminal app still has the extra characters:

image

@Gelio just out of curiosity, was broot working fine on Mac before recently?

I switched to Mac recently and I can't tell, as I haven't used broot a lot recently :/ sorry

@zeenix
Copy link

zeenix commented Mar 10, 2024

I checked out that commit and it looks like the problem is fixed for me on kitty

Nice! Thanks so much for testing.

Interestingly, the macOS Terminal app still has the extra characters:

That's just the Terminal app being silly AFAICT. If you revert the commit to before my recent changes (git checkout abfb5aae9e7539cb9cd3c8b3fcc98a7dfa5e6276) and run the example, you'll still see those. I'd just say do what everyone does on Mac: stick to iTerm2. :)

@Gelio just out of curiosity, was broot working fine on Mac before recently?

I switched to Mac recently and I can't tell, as I haven't used broot a lot recently :/ sorry

No worries. I can verify that at least kitty worked fine before my recent changes. My own app (gimoji) didn't work correctly though when launched from a git hook. In any case, I think we've now a fix for all that is fixable. :)

@CarterLi
Copy link

Same issue for iTerm in macOS

@Canop Canop closed this as completed in ce4780b Mar 11, 2024
@Canop
Copy link
Owner

Canop commented Mar 11, 2024

The fix has been released with version 1.36.1 @CarterLi @zeenix @Gelio

@Gelio
Copy link
Author

Gelio commented Mar 11, 2024

I just upgraded and the problem no longer exists for me on Kitty (both in and outside of tmux)

Thanks @Canop and @zeenix for delivering a quick fix 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Mac
Projects
None yet
Development

No branches or pull requests

4 participants