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

Add unscroll to the rc protocol #3604

Closed
resolritter opened this issue May 9, 2021 · 4 comments
Closed

Add unscroll to the rc protocol #3604

resolritter opened this issue May 9, 2021 · 4 comments

Comments

@resolritter
Copy link

Is your feature request related to a problem? Please describe.

Title is self-explanatory. Since there's scroll-window already, I think unscroll will fit as well.

I've tried to use the escape code with kitty @ send-text (kitty @ send-text --match id:$id '\033[3+T') but it didn't work; I can open another issue for that if it's interesting. I'd still prefer to use it through the protocol rather than sending the escape code, though.

@kovidgoyal
Copy link
Owner

scroll-window scrolls the kitty viewport, not the actual screen contents, unlike unscroll. What is the actual usecase you are trying to implement? send-text will not work since the unscroll command has to come from the client to the terminal, send text goes from the terminal to the client. You can just do printf with the escape code, assumingyour script is running inside the window you want to unscroll and not elsewhere.

@resolritter
Copy link
Author

What is the actual usecase you are trying to implement?

I am trying to unscroll a remote terminal running a Bash shell

send-text will not work since the unscroll command has to come from the client to the terminal, send text goes from the terminal to the client

I don't understand those subjects well, but that gave me some hints; I suppose I can do either

  • kitty @ send-text --match id:$id "printf '\033[3+T'\x0d" (i.e. "type" the command in the remote shell and execute it with Return)
    • Downside: it's slower and more susceptible to failure; seems unnecessary to execute a command for this
  • Write the escape code to the remote shell's tty directly
    • Downside: more complicated and not as straightforward as using rc protocol

Using the protocol is both faster and more straightforward than doing either of the above.

Feel free to close this issue if you think this change is unwarranted. My main argument here is that the alternatives not as straightforward or pleasant as using the protocol (for my needs).

@kovidgoyal
Copy link
Owner

kovidgoyal commented May 10, 2021 via email

@resolritter
Copy link
Author

My particular case is: a command in this remote shell might fail sporadically, so when that happens I want to remove their output by unscrolling. Either using printf or writing to the tty are worse options than using the protocol for me since remote control is always available and that is more direct, faster, simpler, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants