charmbracelet / charmbracelet/bubbletea

unknownCSISequenceMsg for 'space bar' on Ubuntu OS

Open
#1,277 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
44.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When holding down the 'shift' key and pressing the 'space-bar' key it causes the message type seen below in the 'Additional context' section. 'shift+space' is something that happens on accident sometimes when typing quickly and normally it just gets treated as a regular space.

**Setup**
Please complete the following information along with version numbers, if applicable.
- OS: Ubuntu - (I tested on MacOS with Wezterm in both bash and zsh and the issue did not occur)
- Shell: Bash or Zsh (can get the issue to happen in either shell)
- Terminal Emulator: WezTerm (I tested on Gnome Terminal and the issue did not occur).
- Terminal Multiplexer: Embedded NVIM terminal (The issue does not occur in Wezterm unless inside an embedded NVIM terminal)

**To Reproduce**
Steps to reproduce the behavior:
1. Ssh into Ubuntu or open native Ubuntu (I produced the issue via ssh to my rasberry pi and natively on my Ubuntu laptop)
2. Open up Wezterm
3. Open up Nvim (I tested with my config disabled and was still able to produce the issue)
4. Open an embedded terminal with ":te"
5. Switch to Bash or Zsh (I tested these only, so it may occur in other shells as well)
6. Add break points or logs inside your model.Update function.
7. Start the Bubbletea application
8. Hold down the 'shift' key and press 'space'
9. Observe something similar to the section 'Additional context' down below.

**Source Code**
Can use any sample from the Bubbletea repo. I noticed the issue in two of my repos so far.

**Expected behavior**
I expect the message type of key to be triggered with the string value of " " in Bubbletea.

**Additional context**
Here is the output of the unexpected message type from my debugger:
 msg github.com/charmbracelet/bubbletea.Msg(github.com/charmbracelet/bubbletea.unknownCSISequenceMsg) = bubbletea.Msg(github.com/charmbracelet/bubbletea.unknownCSISequenceMsg) [27,91,51,50,59,50,117]
 data github.com/charmbracelet/bubbletea.unknownCSISequenceMsg = bubbletea.unknownCSISequenceMsg len: 7, cap: 256, [27,91,51,50,59,50,117]
string() string = "\x1b[32;2u"
[0] uint8 = 27 = 0x1b
[1] uint8 = 91 = 0x5b
[2] uint8 = 51 = 0x33
[3] uint8 = 50 = 0x32
[4] uint8 = 59 = 0x3b
[5] uint8 = 50 = 0x32
[6] uint8 = 117 = 0x75
> bubbletea.unknownCSISequenceMsg len: 7, cap: 256, [27,91,51,50,59,50,117]

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with a sample from the Bubbletea repository using Ubuntu, WezTerm, an embedded Nvim terminal, and Bash or Zsh. Start by tracing the model.Update input and the unknownCSISequenceMsg value for \x1b[32;2u. Done means Shift+Space produces a key message whose string value is a regular space.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, go, linux, neovim, zsh
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.