Scroll with shift+home,end,pageup,pagedown

This commit is contained in:
Jeremy Soller 2024-04-08 08:44:32 -06:00
parent 782bce1f01
commit 770549e93b
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 25 additions and 5 deletions

View file

@ -2231,7 +2231,7 @@ impl Application for App {
}
TermEvent::ChildExit(_error_code) => {
//Ignore this for now
},
}
}
}
Message::TermEventTx(term_event_tx) => {

View file

@ -608,8 +608,22 @@ where
let escape_code = match named {
Named::Insert => csi("2", "~", mod_no),
Named::Delete => csi("3", "~", mod_no),
Named::PageUp => csi("5", "~", mod_no),
Named::PageDown => csi("6", "~", mod_no),
Named::PageUp => {
if modifiers.shift() {
terminal.scroll(TerminalScroll::PageUp);
None
} else {
csi("5", "~", mod_no)
}
}
Named::PageDown => {
if modifiers.shift() {
terminal.scroll(TerminalScroll::PageDown);
None
} else {
csi("6", "~", mod_no)
}
}
Named::ArrowUp => {
if is_app_cursor {
ss3("A", mod_no)
@ -639,14 +653,20 @@ where
}
}
Named::End => {
if is_app_cursor {
if modifiers.shift() {
terminal.scroll(TerminalScroll::Bottom);
None
} else if is_app_cursor {
ss3("F", mod_no)
} else {
csi("F", "", mod_no)
}
}
Named::Home => {
if is_app_cursor {
if modifiers.shift() {
terminal.scroll(TerminalScroll::Top);
None
} else if is_app_cursor {
ss3("H", mod_no)
} else {
csi("H", "", mod_no)