Commit graph

14 commits

Author SHA1 Message Date
赵鑫亿
9806b0c763
fix(exec): clear View before releasing terminal for subprocess (#1762)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Drew Smirnoff <drew@charm.land>
2026-11-12 17:23:45 +04:00
Ayman Bagabas
78e3b36c60
fix: remove resetLinesRendered calls around exec
Resetting the lines rendered around exec was causing issues with cursor
position after exec commands. For example, if you want to persist the
output of your program after an exec command that uses the altscreen,
this would break that functionality.

We really need to choose one behavior or the other here, and I think
removing these calls is the right choice.

Reference: https://github.com/charmbracelet/bubbletea/pull/1276
Reference: https://github.com/charmbracelet/bubbletea/issues/1275
2025-10-14 13:34:51 -04:00
Ayman Bagabas
f4c5598bfc
Merge branch 'v2-exp' into v2-exp-tv-io-viewable 2025-07-07 16:49:52 -04:00
Ayman Bagabas
911530d0a3
Merge branch 'main' into v2-exp 2025-07-07 16:42:38 -04:00
Ayman Bagabas
33dd5b01ba
refactor: rework tracing and use a standalone logger 2025-05-19 13:23:45 -04:00
Raphaël Vigée
78ed49b060
fix: maintain exec output (#1276)
* Maintain exec output

* add test

---------

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
2025-05-13 12:27:50 -04:00
Ayman Bagabas
d1fa13cdba
fix: reset renderer and cursor when releasing terminal (#1321)
The cursed renderer moves the cursor between renders, which can cause
issues when the terminal is released and restored. For instance, when
we exec a command using tea.Exec, we want the cursor position to remain
the same after the command finishes and goes back to the same position
as before the command was executed.

With tea.Suspend on the other hand, we want to make sure we reset the
cursor position because the program stops executing and is put to
suspend. Resuming the program again initializes the renderer and its
cursor position again from scratch as if it was a new program.

This wasn't an issue for the standard renderer because we always put the
cursor at the lower left corner of the screen. Releasing and restoring
the program wasn't an issue because the cursor was always at the same
position.
2025-02-11 12:29:34 -05:00
Ayman Bagabas
9636413107 fix: use safeWriter to guard writing to output
This implements a wrapper around p.output that locks the output on every
write. We also need to redefine `channelHandlers` to be thread-safe
since `p.Kill()` can be called from a different thread while the program
is running.
2024-09-12 13:22:33 -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
Christian Muehlhaeuser
741f2d37f0 fix: pass actual stdout's fd to command 2022-11-01 00:21:02 +01:00
Josh Soref
4aa9ce489b
docs: fix spelling / various typos (#526) 2022-10-11 14:40:01 +02:00
Dakota Walsh
f905b97756 docs: fix typo
The previous example was wrong and would result in the following
compiler error:
error (type) is not an expression

Just a simple typo, I've changed it to err to correctly reference the
function scoped variable named err.
2022-08-27 10:22:11 +02:00
Christian Muehlhaeuser
1e1b5f716d chore: gofmt sources 2022-08-15 12:25:55 +02:00
Christian Rocha
775dbfbeff
chore(exec): small API edits (#323)
* feat: add OSExec helper function for running exec.Cmds

* chore: for now, un-expose WrapExecCommand

* chore: move exec struff into its own file

* chore(exec): better name for Exec func that wraps exec.Cmd (thanks, @toby)
2022-06-01 17:12:21 -07:00