Skip to content

[BUG] weird encoding issues on (ghostty) terminals #286

Closed

Description

@miekg

Describe the bug

When running local uc commands I get weird artifacts on my screen

% ./uncloud machine ls
^[[?2026;2$y^[[?2027;1$yNAME        STATE   ADDRESS         PUBLIC IP   WIREGUARD ENDPOINTS                      MACHINE ID
machine-1   Up      10.210.0.1/24   -           172.19.0.2:51820, 131.174.139.88:51820   656c506c2da5e6012a3f20a157d709fe

Expected behavior

Don't print any escapes

Environment:

asahalinux fedora32/ghostty 1.3.1

  • Uncloud versions: main from github

I've seen the color and palette stuff in other PRs, my hunch is, this is not compatible. An option to disable all these colorization would also be nice (i'm colorblind, so I also want different colors)

This seems to be a "This type of sequence is commonly referred to as a CSI (Control Sequence Introducer)"... wat

Activity

  1. miekg commented on Mar 24, 2026

    @miekg
    ContributorAuthor

    tried different terminals, term infos, shells and shell prompts, but doesn't seem to be that.

  2. miekg commented on Mar 24, 2026

    @miekg
    ContributorAuthor

    % ./uncloud machine ls | cat fixes it. It's the connectClusterWithProgress which uses tea which breaks on fedora for some reason

  3. miekg commented on Mar 24, 2026

    @miekg
    ContributorAuthor
  4. changed the title [-][BUG] weird encoding issues on ghostty terminal[/-] [+][BUG] weird encoding issues on (ghostty) terminals[/+] on Mar 24, 2026
  5. psviderski commented on Mar 25, 2026

    @psviderski
    Owner

    Bubbletea/lipgloss should support NO_COLOR=1 (https://no-color.org/) to disable colours in the output out of the box.

    But this is only about colours, other control characters could still be used, e.g. for printing an interactive progress when connecting to the cluster.

    It would be helpful if you can try some of the fixes linked in charmbracelet/bubbletea#1590.

    I was not able to reproduce this in iterm2/ghostty/Terminal using fish/bash/zsh on macOS.

  6. miekg commented on Mar 25, 2026

    @miekg
    ContributorAuthor

    i think I just have to sit it out and wait for it to be fixed upstream

  7. miekg commented on Mar 25, 2026

    @miekg
    ContributorAuthor
    diff --git i/go.mod w/go.mod
    index b278c90..c59f08a 100644
    --- i/go.mod
    +++ w/go.mod
    @@ -2,6 +2,8 @@ module github.com/psviderski/uncloud
    
     go 1.26
    
    +replace charm.land/bubbletea/v2 => github.com/saltydk/bubbletea/v2 v2.0.0-20260318220615-96c1e05cb8c1
    +
     require (
            charm.land/bubbles/v2 v2.0.0
            charm.land/bubbletea/v2 v2.0.2
    diff --git i/go.sum w/go.sum
    index 2a1ef70..de0fb70 100644
    --- i/go.sum
    +++ w/go.sum
    @@ -1078,6 +1078,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
     github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
     github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
     github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
    +github.com/saltydk/bubbletea/v2 v2.0.0-20260318220615-96c1e05cb8c1 h1:PQLktKXSoxCBczHOJWjAIi0dDlSx2zZ6/b5kzIOSmFs=
    +github.com/saltydk/bubbletea/v2 v2.0.0-20260318220615-96c1e05cb8c1/go.mod h1:ukj5SpUwpemB+rLyqsw+R6SIDaQE53fMxZsojTUQrxc=
     github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
     github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
     github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=

    fixes it, but that is not the official fix (and not the official repo!)

    % ./uncloud machine list
    NAME        STATE   ADDRESS         PUBLIC IP   WIREGUARD ENDPOINTS                      MACHINE ID
    machine-1   Up      10.210.0.1/24   -           172.19.0.2:51820, 131.174.139.88:51820   58de29fd9f276a1cc05d95504e2ff5aa
  8. miekg commented on Apr 16, 2026

    @miekg
    ContributorAuthor

    with the control master stuff, this is now happening all the time and it's driving me nuts. I'll ping (sigh) the bug

  9. miekg commented on Apr 16, 2026

    @miekg
    ContributorAuthor

    another symptom:

     ./uc machine rm machine-9jfd                                                                               ~miekg/uncloud/cmd/uncloud main
    ^[[?2026;2$y^[[?2027;2$yNo service containers found on machine 'machine-9jfd'.
    This will remove the machine from the cluster and reset it to the uninitialised state.
    Do you want to continue? [y/N] y
    invalid input. please try again
    Do you want to continue? [y/N] y
    
    Machine 'machine-9jfd' removed from the cluster.
    Machine reset initiated and will complete in the background.
    
  10. miekg commented on Apr 21, 2026

    @miekg
    ContributorAuthor

    bubbletea is in no rush to fix this... as an intermediate fix (I tried some source level fixes, but these all failed), I'm now using this function:

    uc () {
            if [[ -x ./uc ]]
            then
                    ./uc "$@" | cat
            fi
    }

    which may help someone else too.

  11. rscorer commented on Apr 23, 2026

    @rscorer

    I have terrible trouble with Ghostty and random characters appearing while SSH'd in. I've done the infocmp -x xterm-ghostty | ssh YOUR-SERVER -- tic -x - incantation and that at least stops ls from being llss
    But I noticed that when I did a do-release-upgrade every time I switched away and back to ghostty there were random characters inserted.
    Don't know if that helps ease the pain, thought I'd throw it in the mix.
    I'm probably going back to Warp or iTerm2...

  12. miekg commented on Apr 23, 2026

    @miekg
    ContributorAuthor

    shell-integration-features = no-cursor,no-title,ssh-env,ssh-terminfo

    takes care of that nowadays

  13. rscorer commented on Apr 23, 2026

    @rscorer

    Amazing, thanks. I will stay with ghostty a little longer 😁

  14. miekg commented on May 17, 2026

    @miekg
    ContributorAuthor

    got a fix fork here https://github.com/miekg/bubbletea
    go mod edit -replace charm.land/bubbletea/v2=github.com/miekg/bubbletea/[email protected] to build uncloud should do the right thing

  15. psviderski commented on Jun 17, 2026

    @psviderski
    Owner

    @miekg I create a bubbletea fork with a modified fix to drain pending TTY input without the 200ms overhead: https://github.com/unlabs-dev/bubbletea/commits/v2.0.8-uncloud.1/
    It's used in main already: 247154e

    Can you please test this works for you as well as I can't reproduce this issue in my terminals.

  16. miekg commented on Jun 17, 2026

    @miekg
    ContributorAuthor

    Look ok. But at $WORK cluster access is slightly slower which may not trigger it. Note I tested this in my fork and there it did work beautifully, so this should work as well.

  17. psviderski commented on Jun 18, 2026

    @psviderski
    Owner

    I'll close this for now. Feel free to reopen if the issue persists.

  18. miekg commented on Jul 27, 2026

    @miekg
    ContributorAuthor

    this is still present :(

    % uc ls                                                                                                                              ~ limos
    ^[[?2026;2$y^[[?2027;1$yNAME          MODE         REPLICAS   IMAGE                                         ENDPOINTS
    caddy         global       1          caddy/caddy:2026-07-25-182223.1ad0fc5.dirty   (custom Caddy config)
    caddy-redis   replicated   1          redis:8.4-alpine
    code          replicated   1          codeberg.org/forgejo/forgejo:16               http://code.atoom.net → :3000, http://code.i.atoom.net → :3000
    docker        replicated   1          docker:dind
    runner        replicated   1          data.forgejo.org/forgejo/runner:12
    %
    /2027;1$y_
    
  19. reopened this on Sep 5, 2026
  20. tonyo commented on Sep 5, 2026

    @tonyo
    Collaborator

    Still an issue on the (currently) latest 0.20.0 for me; can reproduce on Macos with Ghostty 1.3.1 or iTerm2 3.6.11.

  21. miekg commented on Sep 7, 2026

    @miekg
    ContributorAuthor

    looks like those charm folks are working on a AI tui instead of maintaining their stuff. As the docker tui stuff is also brittle it might make sense to move everything over to something more stable (don't know what though)

  22. tonyo commented on Sep 27, 2026

    @tonyo
    Collaborator

    @miekg This fixes the issue for me, feel free to test: #435

  23. miekg commented on Sep 28, 2026

    @miekg
    ContributorAuthor

    Saw it! Thanks!

    It's looking good, thanks for tackling this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions