mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 09:40:25 +01:00
Prevent scrollback buffer reset when using copy shortcut
Prevents scrollback buffer reset (i.e. scrolling to the bottom of terminal output) when pressing modifier keys in isolation or when copying text using the shortcut Ctrl+Shift+C.
This commit is contained in:
parent
cf613708c4
commit
b76f8d0939
2 changed files with 10 additions and 2 deletions
|
@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Shortcuts starting with Ctrl + Shift. This includes the remaining default terminal
|
- Shortcuts starting with Ctrl + Shift. This includes the remaining default terminal
|
||||||
panel shortcuts such as 'Copy' (Ctrl+Shift+C) and 'New Terminal' (Ctrl+Shift+T).
|
panel shortcuts such as 'Copy' (Ctrl+Shift+C) and 'New Terminal' (Ctrl+Shift+T).
|
||||||
- Target Godot version from 3.3.2-stable -> 3.4.4-stable.
|
- Target Godot version from 3.3.2-stable -> 3.4.4-stable.
|
||||||
|
- Prevent scrollback buffer reset (i.e. scrolling to the bottom of terminal output) when
|
||||||
|
pressing modifier keys in isolation or when copying text using the shortcut Ctrl+Shift+C.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
- Removed custom TerminalSettings Resource type.
|
- Removed custom TerminalSettings Resource type.
|
||||||
|
|
|
@ -175,8 +175,14 @@ func _refresh():
|
||||||
func _gui_input(event):
|
func _gui_input(event):
|
||||||
_native_terminal._gui_input(event)
|
_native_terminal._gui_input(event)
|
||||||
|
|
||||||
if event is InputEventKey:
|
if event is InputEventKey and event.pressed:
|
||||||
_native_terminal.sb_reset() # Return to bottom of scrollback buffer if we scrolled up.
|
# Return to bottom of scrollback buffer if we scrolled up. Ignore modifier
|
||||||
|
# keys pressed in isolation or if Ctrl+Shift modifier keys are pressed.
|
||||||
|
if (
|
||||||
|
not event.scancode in [KEY_ALT, KEY_SHIFT, KEY_CONTROL, KEY_META, KEY_MASK_CMD]
|
||||||
|
and not (event.control and event.shift)
|
||||||
|
):
|
||||||
|
_native_terminal.sb_reset()
|
||||||
|
|
||||||
_handle_mouse_wheel(event)
|
_handle_mouse_wheel(event)
|
||||||
_handle_selection(event)
|
_handle_selection(event)
|
||||||
|
|
Loading…
Reference in a new issue