Commit graph

15 commits

Author SHA1 Message Date
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
d124f20f36
Remove custom TerminalSettings Resource type
There is no current public use for this type and it would appear in every
resource dropdown.

While this type is no longer exposed publically by the plugin it is still
used internally by terminal_panel.
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
3e2162d366
Add basic .xrdb/.Xresources import plugin
Adds basic support for importing .Xresources and .xrdb files as Theme
resources.

Examples of terminal color schemes in .xrdb format can be found here:
https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/xrdb

Examples of terminal themes in .Xresources format can be found here:
https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/Xresources

https://terminal.sexy also supports exporting themes is Xresources
format.
2021-07-19 00:10:16 +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
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
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
Leroy Hopson
0dd2378387 Add new PTY node (replaces Pseudoterminal node)
Uses fork of node-pty native code for forking pseudoterminals.
Uses libuv pipe handle to communicate with the child process.

- Paves the way for cross-platform (Linux, macOS and Windows) support.
- Renames Pseudoterminal to PTY (which is much easier to type and spell :D).
- Better performance than the old Pseudoterminal node. Especially when
  streaming large amounts of data such as running the `yes` command.
- Allows setting custom file, args, initial window size, cwd, env vars
  (including important ones such as TERM and COLORTERM) and uid/gid
  on Linux and macOS.
- Returns process exit code and terminating signal.
2021-07-03 14:56:27 +07:00
Leroy Hopson
bd296364d3
Remove unused/debug code 2021-06-19 20:30:43 +07:00
Leroy Hopson
f43149f204 Format files using GDScript Toolkit
https://github.com/Scony/godot-gdscript-toolkit
2021-06-06 16:25:19 +07:00
Leroy Hopson
db6486e6f3 Add asciicast importer
Former-commit-id: ffa8561865
2020-10-05 17:56:57 +07:00
Leroy Hopson
ee6d7cb0fa Refactor file structure
Former-commit-id: 3eecf504cf
2020-10-05 17:56:57 +07:00
Leroy Hopson
a022104230 Remove gdscript version and replace with native
Former-commit-id: f9474fe533
2020-10-05 17:56:55 +07:00
Leroy Hopson
0769592a1b Add/update more files 2020-05-17 17:32:06 +07:00
Leroy Hopson
96e9ddcf79 Add all the files 2020-05-10 01:42:19 +07:00