gum icon indicating copy to clipboard operation
gum copied to clipboard

gum produces 11;rgb:1e1e/1e1e/1e1e in GNU/screen

Open ckujau opened this issue 1 year ago • 1 comments

Describe the bug Just installed v0.13.0 and wanted to show the help menu, all while running in a GNU/screen session and a string 11;rgb:1e1e/1e1e/1e1e is printed to stdout.

To Reproduce Steps to reproduce the behavior:

# Start GNU/screen w/o any local configuration

$ screen -c /dev/null -US test
$ gum --help | wc -l
^[]11;rgb:1e1e/1e1e/1e1e^[\24
 11;rgb:1e1e/1e1e/1e1e                          <== press ENTER again
-bash: 11: command not found
-bash: rgb:1e1e/1e1e/1e1e: No such file or directory

Expected behavior gum should not display garbage to stdout when running in GNU/screen :-)

The same, w/o GNU/screen:

$ gum --help | wc -l
24

=> OK

Desktop (please complete the following information):

  • OS: Fedora 39
  • gum version v0.13.0 (a11d1ff)

Additional context

Running in tmux doesn't show this behaviour, so I guess it's some weird interaction with screen.

ckujau avatar Feb 21 '24 14:02 ckujau

Turns out the TERM variable makes a difference here (this screen commit tipped me off). Usually it's set to xterm:

$ echo $TERM
xterm

$ gum --help | wc -l
^[]11;rgb:1e1e/1e1e/1e1e^[\24

$ export TERM=screen-256color
$ gum --help | wc -l
24

Much better, no more garbage on the screen. Maybe this issue can be closed, but I've never seen such behaviour from other applications, so I'll just leave it open for a while.

ckujau avatar Feb 21 '24 20:02 ckujau