Commit graph

21 commits

Author SHA1 Message Date
Yongteng Lei
c30088fd4e
chore: correct DisableBracketedPaste behavior in comment (#1458) 2025-07-28 10:01:06 -04:00
Ayman Bagabas
cb6f8402f6
chore: revert "chore: deprecate some StartupOptions in favor of Cmds (#1307)"
This reverts commit 75d1b4b8cf.
2025-02-11 10:29:26 -05:00
Ayman Bagabas
ee7cf45a37
chore: revert "Remove irrelevant option comments"
This reverts commit 439398b1dd.
2025-02-11 10:26:08 -05:00
nervo
439398b1dd Remove irrelevant option comments 2025-02-07 09:09:26 -05:00
Christian Rocha
75d1b4b8cf
chore: deprecate some StartupOptions in favor of Cmds (#1307) 2025-02-04 15:46:31 -05:00
Ayman Bagabas
e58efab371
feat: support focus-blur events (#1122)
* feat: support focus-blur events

This backports @caarlos0 focus-blur changes from v2-exp to v1 https://github.com/charmbracelet/bubbletea/pull/1081

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Update key_sequences.go

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: go mod tidy

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2024-08-30 09:20:01 -04:00
Ayman Bagabas
eb78a8cf6a
fix: program renderer commands (#1030)
Using program commands like p.EnableMouseCellMotion and p.SetWindowTitle
_before_ the program starts can panic the application since `renderer`
hasn't been initialized yet. Use program options to enable and set these
options if `renderer` is not initialized.

Fixes: https://github.com/charmbracelet/bubbletea/issues/1029
2024-05-30 14:28:24 -04:00
Ayman Bagabas
cb801d8f2c
refactor: use x/term and x/ansi for renderer sequences (#962)
* refactor: use x/exp/term for renderer sequences

This replaces termenv.Output with raw sequences and a bytes.Buffer to
handle vt screen and cursor events.

* chore: update dependencies

* refactor: use x/term
2024-05-21 14:46:11 -04:00
Raphael 'kena' Poss
2b46020ca0
feat: bracketed paste (#397)
* feat: bracketed paste

This introduces support for input via bracketed paste, where escape
characters in the pasted input are not interpreted.

Pasted input are marked as a special field in the KeyMsg. This is
useful because pasted input may need sanitation in individual widgets.

* fix(key): support bracketed paste with short reads

Some terminal emulators feed the bracketed paste data in multiple
chunks, which may not be aligned on a 256 byte boundary. So it's
possible for `input.Read` to return less than 256 bytes read
but while there's still more data to be read to complete a bracketed
paste input.

---------

Co-authored-by: Christian Muehlhaeuser <muesli@gmail.com>
2024-02-05 14:49:09 +01:00
Ayman Bagabas
2bcb0af2e2
feat: add set-window-title command (#611)
Set the terminal window title using termenv.

Fixes: https://github.com/charmbracelet/bubbletea/issues/610
2023-12-04 11:50:27 -05:00
Josh Soref
4aa9ce489b
docs: fix spelling / various typos (#526) 2022-10-11 14:40:01 +02:00
Raphael 'kena' Poss
6e1065830a feat: support a Clear command 2022-10-04 06:01:52 +02:00
Christian Muehlhaeuser
37b79f55f1 feat: add tea.ShowCursor, complementing tea.HideCursor 2022-10-04 05:39:38 +02:00
Christian Muehlhaeuser
e4ca150210 chore: reorganize screen commands & messages 2022-10-04 05:20:07 +02:00
Christian Muehlhaeuser
6c449e55bf feat: use Termenv.Output to write to tty 2022-09-27 02:49:36 +02:00
Christian Muehlhaeuser
3795c036c4
add: Exec, ReleaseTerminal and RestoreTerminal to re-use input and terminal (#237)
* add: program.ReleaseTerminal and RestoreTerminal to re-use input & terminal

* chore(examples): add altscreen toggling to exec demo

* chore: put low-level altscreen stuff alongside other screen funcs

* docs: edit GoDocs for ReleaseTerminal and RestoreTerminal

* feat(renderer): add internal Msg renderMsg to immediately repaint

* fix: repaint instantly on RestoreTerminal

* fix: restore the altscreen state when restoring the terminal

* feat: implement Cmd-based API for blocking *exec.Cmds

* feat: allow Exec to return custom messages

* feat: allow Exec to be run without a callback

* fix: separate parameters for exec.Command examples

* fix: error message would get printed over by prompt in exec example

* fix: ignore signals while child process is running

* feat: allow to execute other things besides exec.Commands (#280)

* feat: allow to execute other things besides exec.Commands.

* fix: lint issues

* fix: renames, examples

* fix: callback type should be exported

* docs(exce): tiny ExecCommand doc comment correction

* chore(exec): break out Cmd for clarity's sake in example

* fix(exec): give the terminal a moment to catch up if exiting altscreen

* docs(exec): tidy up doc comments

* chore(exec): disambiguate methods for restoring the terminal state vs input

Co-authored-by: Christian Rocha <christian@rocha.is>
Co-authored-by: Carlos A Becker <caarlos0@gmail.com>
2022-04-12 10:23:10 -04:00
Christian Rocha
6d70abd7d5 When showing/hiding the cursor operate on the program's io.Writer
Previously we were operating on io.Stdout.
2020-12-03 13:56:37 -05:00
Christian Rocha
00f7f5be93
Remove cursor save/restore as it was wrecking things
Also, um, we didn't need it.
2020-06-18 20:10:20 -04:00
Christian Rocha
8539cfcf8c
Fix a bug where left area on the first line was not always cleared 2020-06-17 14:50:39 -04:00
Christian Rocha
090c983bd5
Bump termenv and futher integrate it into terminal controls 2020-06-17 11:17:41 -04:00
Christian Rocha
683473c26d
Blind pass at adding high performance scrolling into the renderer 2020-06-16 22:06:46 -04:00