fix: session_restore: replay tracked input modes with the restore buffer - #404
fix: session_restore: replay tracked input modes with the restore buffer#404dob323 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Oh, also please disclose your use of AI to generate this patch, as requested by the PR template. |
ethanpailes
left a comment
There was a problem hiding this comment.
Just realized this needs test coverage.
60e7e39 to
2094d7c
Compare
|
@googlebot I signed it! |
|
Could you add tests? |
|
I think a new case in the attach test suite would make sense. |
2094d7c to
2a219eb
Compare
Restoring only the screen contents leaves a freshly attached terminal without the input modes the application enabled, so bracketed paste, application cursor/keypad and mouse reporting are silently lost across a reattach. A paste then arrives unbracketed and every newline in it submits early. Covered by attach::screen_restore_input_modes, which drives mouse reporting (nothing in the shell sets it) and asserts the reattach re-arms it.
2a219eb to
4ebb204
Compare
|
Sorry, I missed your test requests from Friday. All three have tests now:
Each one fails on master and passes with its patch. |
ethanpailes
left a comment
There was a problem hiding this comment.
Looks great, thanks!
|
I don't see the usual CI actions. I think there might be some sort of global admin change that I need to figure otu before merging. |
|
I filed a bug about these scan checks that are holding up CI. They should not be taking this long to run. |
Issue Link
(none)
AI Policy Ack
I have read the AI Policy. This patch was written with Claude Code, working from failures in my own shpool deployment. Test coverage was added during review:
attach::screen_restore_input_modes, which fails without the fix.This PR was:
Description
On attach, the vt100 restore paths replay screen contents
(
contents_formatted/last_n_rows_contents_formatted) but never theinput modes the application enabled, although the engine already tracks
them and exposes
input_mode_formatted()(application keypad/cursor,bracketed paste, mouse protocol). A freshly connected client therefore
starts with those modes off while the application inside believes they are
on.
The visible failure is pasting into a reattached session: terminals with
paste protection prompt ("paste may be dangerous"), and the paste arrives
unbracketed so embedded newlines submit immediately. A TUI composer
receives a multi-line paste as several submitted lines.
This appends
input_mode_formatted()to both vt100 restore buffers. Thesimplemode and vterm engine are unchanged.