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

Weird escape code issues with v1.158.0 #1026

Closed
mss opened this issue Feb 5, 2025 · 4 comments · Fixed by #1029
Closed

Weird escape code issues with v1.158.0 #1026

mss opened this issue Feb 5, 2025 · 4 comments · Fixed by #1029
Labels
bug 🐛 An issue with the system

Comments

@mss
Copy link
Contributor

mss commented Feb 5, 2025

Describe the Bug

In #1019 I mentioned that v1.158.0 is "completely broken" for us. I did some additional debugging and it looks like this is somehow caused by the default configuration (ie. no atmos.yaml file in the current directory) or the atmos.yaml we have in our projects. The issue goes away if I execute the steps below within the clone of the atmos repository (ie. the default ´atmos.yaml` as of today) I had laying around.

Our problem: The atmos commands spill out some excessive escape codes before and after each command. The latter even somehow enter my bash history. The same for a colleague who uses zsh. I put examples under "Screenshots" below.

Expected Behavior

No random escape codes spilled out of atmos and even into my bash history.

Steps to Reproduce

  1. Maybe use bash on Ubuntu 24.04 with liquidprompt installed?
  2. Make sure you have no atmos.yaml in your current working directory.
  3. Execute atmos version (or any other command; we tried atmos vendor pull as well and that one only shows the escape code garbage and nothing else).

Screenshots

I use mise to test different atmos versions.

1.159.0 (and 1.158.0) looks like this:

:/tmp $ mise exec atmos@1.159.0 -- atmos version
^[]11;rgb:2323/2626/2727^[\^[[72;1R
 █████  ████████ ███    ███  ██████  ███████ 
██   ██    ██    ████  ████ ██    ██ ██      
███████    ██    ██ ████ ██ ██    ██ ███████ 
██   ██    ██    ██  ██  ██ ██    ██      ██ 
██   ██    ██    ██      ██  ██████  ███████ 
                                             

👽 Atmos 1.159.0 on linux/amd64

1.157.0 looks like this:

:/tmp 130 $ mise exec atmos@1.157.0 -- atmos version                                                                                                                                                                                         
 █████  ████████ ███    ███  ██████  ███████ 
██   ██    ██    ████  ████ ██    ██ ██      
███████    ██    ██ ████ ██ ██    ██ ███████ 
██   ██    ██    ██  ██  ██ ██    ██      ██ 
██   ██    ██    ██      ██  ██████  ███████ 
                                             

👽 Atmos 1.157.0 on linux/amd64

Image

Environment

  • OS: Linux (Ubuntu and Arch)
  • Shell: bash (with liquidprompt) and zsh
  • Version: 1.158.0 and 1.159.0

Additional Context

No response

@mss mss added the bug 🐛 An issue with the system label Feb 5, 2025
@mss
Copy link
Contributor Author

mss commented Feb 5, 2025

I found the cause: We still had this in our atmos.yaml:

logs:
  file: '/dev/stdout'
  level: Info

I guess stdout is also still the default without a config but the shipped atmos.yaml sets that to stderr which avoids the issue.

mss added a commit to mss/atmos that referenced this issue Feb 5, 2025
This syncs the default value with the one shipped in `atmos.yaml`. It
avoids the logging bug in cloudposse#1026.
@verygitmuchhub
Copy link

Hey there, zsh-colleague here.

I'd like to add that this behaviour is not mise- specific. Same issues for me with both tenv and calling atmos directly.

@Nuru
Copy link
Contributor

Nuru commented Feb 5, 2025

Background information:

The "weird escape codes" you are seeing are OSC (Operating System Command) responses from the terminal indicating the terminal's foreground and background color settings. They are output by the terminal in response to corresponding queries. When used properly, the code that issues the query reads the response and you never see it. When done wrong, the response goes to the terminal window as if it were typed from the keyboard, which is why it shows up in your command history.

I do not believe this problem is with Atmos code per se, but rather with library code Atmos is using for fancy output. In any case, we are actively working on resolving this, but until then, you may want to stick with Atmos 1.157.0

@mss
Copy link
Contributor Author

mss commented Feb 6, 2025

@Nuru Thanks for the information, I actually learned something new!

For now we found the "workaround" to log to stderr as we should have done from the beginning. With that other issue fixed it looks like we don't have to stick on our old version anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants