Commit Graph

13 Commits

Author SHA1 Message Date
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