When hard tabs are enabled, we optimize rendering by using actual tab
characters instead of spaces. This requires us to set tab stops every 8
columns at the beginning of the rendering process.
Fixes: https://github.com/charmbracelet/bubbletea/issues/1614
When the terminal supports it, we now enable Unicode mode (ANSI mode
2027) to ensure accurate width calculation for wide characters and
emojis. This improves rendering fidelity in terminals that support this
mode.
Modified keys (shift+enter, ctrl+i, etc.) don't work in tmux because
tmux doesn't support the Kitty keyboard protocol. tmux requires
applications to request extended-keys using modifyOtherKeys (CSI > 4 ; 2 m).
The workaround is setting 'extended-keys always' in tmux config (tmux 3.2+),
but users may not know this is the issue, and forcing extended-keys for all
applications may not be desired. This fix sends modifyOtherKeys requests
alongside Kitty protocol sequences, enabling proper key handling in tmux
automatically.
* fix(renderer): reset kitty keyboard protocol on alt screen switch
We need to reset the kitty keyboard protocol when switching between main
and alt screens. This is because kitty maintains separate keyboard
protocol registries for each screen, and failing to reset the protocol
can lead to issues such as the inability to use the Ctrl key in some
editor that don't support kitty's keyboard protocol.
* chore: update golden files to match the renderer output
When the renderer is being closed, we should avoid requesting kitty
keyboard enhancements so that we don't leave the terminal with unhandled
input sequences.
* fix: windows: enable mouse mode on demand
This fixes an issue where mouse mode is always enabled on Windows. With
this patch, we enable mouse events only it is requested.
Needs: https://github.com/charmbracelet/x/pull/386
Related: https://github.com/charmbracelet/bubbletea/issues/1313
* refactor: mouse: properly handle mouse mode
Since mouse mode has a special case on Windows, we now have
separate msg types for mouse events.
* chore: go mod tidy