Attempt to improve support for Simple terminal on linux. #112

This commit is contained in:
Federico Terzi 2019-12-13 21:57:06 +01:00
parent 1f5cdc025d
commit 284482e2d5
4 changed files with 16 additions and 0 deletions

View File

@ -303,6 +303,10 @@ void trigger_shift_ins_paste() {
xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Shift+Insert", 8000);
}
void trigger_alt_shift_ins_paste() {
xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Shift+Alt+Insert", 8000);
}
// SYSTEM MODULE
// Function taken from the wmlib tool source code
@ -465,8 +469,12 @@ int32_t is_current_window_terminal() {
return 1;
}else if (strstr(class_buffer, "Terminator") != NULL) { // Terminator
return 1;
}else if (strstr(class_buffer, "stterm") != NULL) { // Simple terminal 3
return 2;
}else if (strstr(class_buffer, "St") != NULL) { // Simple terminal
return 1;
}else if (strstr(class_buffer, "st") != NULL) { // Simple terminal 2
return 1;
}else if (strstr(class_buffer, "Alacritty") != NULL) { // Alacritty terminal
return 1;
}

View File

@ -87,6 +87,11 @@ extern "C" void trigger_terminal_paste();
*/
extern "C" void trigger_shift_ins_paste();
/*
* Trigger alt shift ins pasting( Pressing ALT+SHIFT+INS )
*/
extern "C" void trigger_alt_shift_ins_paste();
// SYSTEM MODULE

View File

@ -43,4 +43,5 @@ extern {
pub fn trigger_paste();
pub fn trigger_terminal_paste();
pub fn trigger_shift_ins_paste();
pub fn trigger_alt_shift_ins_paste();
}

View File

@ -48,6 +48,8 @@ impl super::KeyboardManager for LinuxKeyboardManager {
// so we need to check the correct situation.
if is_terminal == 0 {
trigger_paste();
}else if is_terminal == 2 { // Special case for stterm
trigger_alt_shift_ins_paste();
}else{
trigger_terminal_paste();
}