mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-10 14:05:32 +02:00
Add clear and sb_reset
Clearing the terminal removes all lines in the scrollback buffer except for the most recent. With sb_reset, the terminal will return the scrollback buffer to the bottom when the user starts typing if they have previously scrolled up.
This commit is contained in:
parent
ebb527cb8b
commit
e8c27f2796
5 changed files with 40 additions and 12 deletions
|
@ -161,14 +161,17 @@ func _on_TerminalPopupMenu_id_pressed(id):
|
|||
match id:
|
||||
TerminalPopupMenuOptions.NEW_TERMINAL:
|
||||
_on_AddButton_pressed()
|
||||
TerminalPopupMenuOptions.PASTE:
|
||||
if tabs.get_tab_count() > 0:
|
||||
var terminal = tab_container.get_child(tab_container.current_tab)
|
||||
|
||||
if tabs.get_tab_count() > 0:
|
||||
var terminal = tab_container.get_child(tab_container.current_tab)
|
||||
match id:
|
||||
TerminalPopupMenuOptions.PASTE:
|
||||
for i in OS.clipboard.length():
|
||||
var event = InputEventKey.new()
|
||||
event.unicode = ord(OS.clipboard[i])
|
||||
event.pressed = true
|
||||
terminal._gui_input(event)
|
||||
TerminalPopupMenuOptions.KILL_TERMINAL:
|
||||
if tabs.get_tab_count() > 0:
|
||||
TerminalPopupMenuOptions.CLEAR:
|
||||
terminal.clear()
|
||||
TerminalPopupMenuOptions.KILL_TERMINAL:
|
||||
_on_Tabs_tab_close(tabs.current_tab)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue