Commit graph

27 commits

Author SHA1 Message Date
Leroy Hopson
95b66115c4
Update/deprecate theme item names
Updates theme names to be compatible with Godot 3.5 (no spaces),
consistent with other Godot theme item names (snake_case), and
match the color names listed on the
[ANSI escape code wikipedia page](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit).

Deprecates the old names and warns users to change them.
2022-08-26 09:28:38 +12:00
Leroy Hopson
6cd5facb98
Deprecate the cols and rows properties of Terminal
As cols and rows are read only (i.e. automatically determined by rect
and font size) there is no need for the properties to be exposed.
Instead, users can get the calculated cols and rows using the get_cols()
and get_rows() methods.
2022-08-22 10:05:36 +12:00
Leroy Hopson
041e7a445f Request redraw after write if terminal visible
Requests a redraw after writing to terminal if it is visible, otherwise
terminal will not be updated if there are no other redraw requests.

Fixes #53.
2022-08-08 10:13:53 +12:00
Leroy Hopson
9896a362c3
Automatic editor updates
Automatic updates applied to scenes after opening in Godot editor
v3.4.4-stable.
2022-08-06 20:32:58 +12:00
Leroy Hopson
df32ee3c18
Refactor PTY
PTY now provides a public interface to an underlying instance of
PTYNative. The PTYNative class can be extended as appropriate for
each platform and the platform-specific implementation will be
selected by PTY at runtime.
2022-07-11 09:33:01 +12:00
Leroy Hopson
6ec3c93c55
Prevent editor shortcuts while terminal is focused 2022-07-11 09:33:00 +12:00
Leroy Hopson
deb68e323c
Reformat existing gdscript code 2022-07-11 09:33:00 +12:00
Leroy Hopson
9d15420df3
Move terminal.gd and pty.gd to godot_xterm directory
Makes for pretty paths when extending scripts:
`extends "res://addons/godot_xterm/terminal.gd"`
vs.
`extends "res://addons/godot_xterm/nodes/terminal/terminal.gd"`

Currently "res://addons/godot_xterm/pty.gd" is acutally `pty_unix.gd`.
This is okay for now as the PTY node is only supported on Unix
platforms. However, we will need to sort it out when adding Windows
support as part of #25.

Also remove the GDXterm namespace.
2021-07-26 00:39:48 +07:00
Leroy Hopson
e6db81615e
Automatic .tscn file updates
Automatically changed by the editor.
2021-07-25 23:09:37 +07:00
Leroy Hopson
082ce8f199
Use only default settings for terminal panel
Until settings have been properly defined, documented and implemented.
2021-07-25 23:09:37 +07:00
Leroy Hopson
c81da3820b
Kill child process and close pty on exit
- Adds kill() method to LibuvUtils.
- Adds close() method to Pipe.
2021-07-23 08:37:54 +07:00
Leroy Hopson
55b0a0577d
Update bell
- Don't add the bell to the archive to keep it small a simplify
  licensing. Also bells seem to be rarely used with terminal emulators.
- Don't play the bell directly from the Terminal node by adding an
  AudioStreamPlayer, but make it easy to tune the "bell" signal behavior
  from the Terminal node so that only an AudioStreamPlayer node's play()
  method needs to be connected to it.
- Keep the bell.wav sound around for testing/demo.
2021-07-23 08:37:49 +07:00
Leroy Hopson
7c3d5f76f3
Make compatible with Godot v3.2
But still only officially support v3.3+
2021-07-20 14:26:34 +07:00
Leroy Hopson
30807f1436
Use relative rather than absolute paths
This should allow GodotXterm be installed in locations other than
`addons/godot_xterm`.
2021-07-15 21:30:09 +07:00
Leroy Hopson
7c6300c8dc
Close terminal on successful exit 2021-07-15 19:33:59 +07:00
Leroy Hopson
ec0d4ddf43
Add popup label to show terminal and panel size on resize
Shows the terminal cols/rows (if a terminal is open) and the size of the
the tab_container in pixels. Shows centered for 1 second, then closes.
2021-07-13 23:34:24 +07:00
Leroy Hopson
de7980c077
Add next/previous tab shortcuts 2021-07-13 22:49:48 +07:00
Leroy Hopson
97e07093b2
Change terminal menu option 'Select All' -> 'Copy All'
Adds copy_all() function to terminal node which returns all of the
screen's text.
2021-07-13 22:20:29 +07:00
Leroy Hopson
703eb68f11
More shortcuts
- Copy
- Paste
- Kill
2021-07-13 16:43:51 +07:00
Leroy Hopson
6106b7f100
Disable default copy on selection 2021-07-13 08:53:15 +07:00
Leroy Hopson
658197f44c
Enable drag to rearrange tabs 2021-07-13 08:51:11 +07:00
Leroy Hopson
8b3c207b0c
Set new terminal shortcut input as handled
Otherwise the input will also be handled by the newly spawned terminal
and ^T will be printed to the screen.
2021-07-13 08:38:50 +07:00
Leroy Hopson
bbe6cb273b
Set terminal panel tabs close button policy to CLOSE_BUTTON_SHOW_ALWAYS
Temporary measure until we can resolve the issue where inactive tabs
would be closed when clicking on the area where the close button will
show when policy was CLOSE_BUTTON_SHOW_ACTIVE_ONLY.
2021-07-13 08:36:49 +07:00
Leroy Hopson
e8c27f2796
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.
2021-07-13 06:33:44 +07:00
Leroy Hopson
ebb527cb8b
Terminal panel updates
- Add TerminalSettings resource.
- Init/load terminal settings from terminal panel.
- Add terminal context menu (i.e. right-click PopupMenu).
- Add shortcut to open a new terminal Ctrl+Shift+T and make terminal panel
  visible.
2021-07-12 23:13:33 +07:00
Leroy Hopson
683b0e3304 Editor terminal use default theme fonts 2021-07-12 22:46:43 +07:00
Leroy Hopson
5e25ebbab6 Add rudimentary terminal to editor's bottom panel
In order to use the gdnative library as an editor plugin it was
neccessary to set the `reloadable` property of the gdnlib file to false,
in order to prevent crashes when the godot editor window lost focus.

This may have consequences when recompiling the library.
See: https://docs.godotengine.org/en/3.3/classes/class_gdnativelibrary.html#class-gdnativelibrary-property-reloadable

Still crashes quite frequently and doesn't close child processes
properly.

Part of #43.
2021-07-11 23:03:33 +07:00