Open MLFlexer opened 1 month ago
Continuing discussion from #39 here @joncrangle:
I agree. This is promising but is a separate feature and could use more testing. I think the solution will involve some variation of the following Wezterm lua functions to get the
pane_id
and return the scrollback text from it:root.pane:pane_id() -- 23 was the pane_id for my SSH domain session wezterm.mux.get_pane(23):get_lines_as_escapes(1000))
It might also make sense to abstract the
get_lines_as_escapes
into its own local function.
That should be the same behaviour as just root.pane:get_lines_as_escapes(1000)
when saving the pane
I found I was unable to inject output in panes within domains, and found this in the docs:
"Not all panes support this method; at the time of writing, this works for local panes but not for multiplexer panes."
For now I see several directions this could be taken.
ctrl-c
or we insert a ctrl-c
control sequence at the end.printf <text> ; sh
One of these are great tho :neutral_face:
For now I see several directions this could be taken.
- Do not save the text for non-local domains
- use get_lines_as_text to store the text only and then send it to the pane with send_text forcing either the user to
ctrl-c
or we insert actrl-c
control sequence at the end.- Spawn the pane with a command like
printf <text> ; sh
One of these are great tho :neutral_face:
I'd be interested in whether others have feedback, because this is not a feature I'm overly concerned about for my personal workflow.
This plugin currently satisfies the pain point I was having by reattaching to SSH and SSHMUX sessions. SSHMUX sessions are already very similar to tmux in that running processes are continued as long as the Wezterm daemon on the server side is still running. I am personally less concerned about the scrollback, but can completely understand if someone else would find it useful.
For now I think not saving lines for non-local panes is the best option, but if someone is reading this and has input on this, please feel free to provide ideas or feedback 😄
See discussion from this comment. Currently there is no way to restore the lines for WSL and SSH domains, but it seems like there might be a way to do so as per the discussion in #39.