Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore lines for non-local domains #41

Open
MLFlexer opened this issue Aug 16, 2024 · 5 comments
Open

Restore lines for non-local domains #41

MLFlexer opened this issue Aug 16, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MLFlexer
Copy link
Owner

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.

@MLFlexer MLFlexer added the enhancement New feature or request label Aug 16, 2024
@MLFlexer
Copy link
Owner Author

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

@MLFlexer
Copy link
Owner Author

MLFlexer commented Aug 17, 2024

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."

@MLFlexer
Copy link
Owner Author

For now I see several directions this could be taken.

  1. Do not save the text for non-local domains
  2. 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 a ctrl-c control sequence at the end.
  3. Spawn the pane with a command like printf <text> ; sh

One of these are great tho 😐

@joncrangle
Copy link
Contributor

For now I see several directions this could be taken.

  1. Do not save the text for non-local domains
  2. 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 a ctrl-c control sequence at the end.
  3. Spawn the pane with a command like printf <text> ; sh

One of these are great tho 😐

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.

@MLFlexer MLFlexer added the help wanted Extra attention is needed label Aug 18, 2024
@MLFlexer
Copy link
Owner Author

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 😄

@MLFlexer MLFlexer changed the title Restore lines for WSL and SSH domains Restore lines for non-local domains Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants