-
Notifications
You must be signed in to change notification settings - Fork 54
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
Remotely run a command in running session an additional command on attach #49
Comments
Hi typkrft, I'm not sure if this will help with your mouse support, but for running a command remotely, you can pipe it to abudco:
Keep in mind that this will send You could also run it with the
This will execute |
Hey thanks for the response. I don't have a p flag or see one documented. Am I missing something? I am running the latest release. Edit: 2nd Edit: |
Do you have a link to documentation about how |
I do not have documentation unfortunately. It's apparently an escape sequence (most?) terminals use to enable mouse support. I found it here actually #26 (comment). I am not using xterm, but this sequence seem to work in kitty, which is what I am using. For what it's worth this does seem to be handled "properly" by tmux. Speaking from an end user perspective, I'm not sure how it's implemented. |
So I played around a little and found those stackoverflow questions:
Both helped me understand a bit what is going on with the escape sequence. But I was not able to enable/re-enable mouse support for I think the problem is that |
Makes sense. Thanks for looking into this. I don't know if I'm kind of an edge case or not but it might be useful to add this complexity to the program if the developers are interested. It's not the end of the world though. I wonder if this hinders anything else maybe I could just fork it and look at the source to see if I can always send it by default on attachment. I'm not sure how tmux handles this yet. I'll do some more digging when I have time. |
Simply adding this static void client_setup_terminal(void) {
if (!has_term)
return;
atexit(client_restore_terminal);
cur_term = orig_term;
cur_term.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXOFF);
cur_term.c_oflag &= ~(OPOST);
cur_term.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
cur_term.c_cflag &= ~(CSIZE|PARENB);
cur_term.c_cflag |= CS8;
cur_term.c_cc[VLNEXT] = _POSIX_VDISABLE;
cur_term.c_cc[VMIN] = 1;
cur_term.c_cc[VTIME] = 0;
tcsetattr(STDIN_FILENO, TCSANOW, &cur_term);
printf("\x1b[?1002h\x1b[?1006h");
if (!alternate_buffer) {
printf("\033[?1049h\033[H");
fflush(stdout);
alternate_buffer = true;
}
} https://github.com/typkrft/abduco/blob/307dfe94d423a0204b6aec7e4f9590e965cecdfb/client.c |
That looks good. I will check out your PR #50. |
Effectively I am trying to figure out if there's a way to automate
echo -e '\x1b[?1002h\x1b[?1006h';
to re-enable mouse support when connect to nvim. I've triedabduco -a nvim; echo -e '\x1b[?1002h\x1b[?1006h';
but it doesn't work.The text was updated successfully, but these errors were encountered: