Commit graph

62 commits

Author SHA1 Message Date
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
b08d218a59
Run tests in CI environment
Currently tests only run on X11.64 platform.
But other platforms can be supported with a bit of effort.
Remove default bell sound as it does not play nicely with CI environment
that does not have sound card.
2021-07-18 23:05:17 +07:00
Leroy Hopson
09dc080a2e Add support for the bell "\a" character
Closes #39
2021-07-03 22:47:33 +07:00
Leroy Hopson
115521f645
Replace Gut with WAT
Gut was freezing on some integration tests. It was also entering an
infinite loop after exiting (even after closing Godot and VSCode) which
caused a `godot.log` file in app_userdata to keep growing until my hard
drive was full.
2021-07-03 21:49:24 +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
d2f073d7ae
Multiple updates
- Use viewport as render target for terminal:
  Terminal now only draws cells which changed since the last _draw() call.
  A viewport is used with clear mode set to NEVER to cache previous draw
  calls. The terminal node and viewport are wrapped by a GDScript Terminal
  node which takes care of resizing the viewport scene, and forcing the
  terminal to redraw all cells when necessary (i.e. on resize or theme
  change).

  Adds update_mode to terminal interface which can be set to one of:
  - DISABLED: terminal will never be drawn
  - AUTO: terminal will only draw the cells that changed, but
    automatically redraw the full screen when necessary (for example,
    when the size or theme changed).
  - ALL: terminal will always draw every cell on every update. This is
    the most reliable but least performant option.
  - ALL_NEXT_FRAME: Will use update_mode ALL for the next _draw() call,
    then change update_mode back to AUTO.

- Upgraded libtsm:
  Includes changes from Fredrik Wikstrom (salass00)'s fork of libtsm.

- Don't require theme to be set.
  Terminal will use default fonts/colors if no theme is set.
2021-06-20 18:33:40 +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
0d4e10f5ab Add more features, bug fixes and bugs ;-)
Most notably:
- Reflow is now working. Terminal size will fill the window and
cols/rows will be resized/calculated based on window and font size.
- Added support for different fonts (i.e. bold, italic, bolditalic).
- Enabled blinking characters.
- Adde more tests and caught a few subtle bugs.
- Removed renderer code (which was part of xterm.js) and just
doing naive rendering in terminal.gd, but it seems to perform
a lot faster.

Still not working completely:
- vim (some weirdness going on).
- vttest (more weirdness).

Todo:
- Fix the above.
- Draw the cursor!
- Improve performance. Performance is still not great. The terminal
becomes unusable when running `yes` or `cmatrix -r`.
2020-05-19 18:55:43 +07:00
Leroy Hopson
0769592a1b Add/update more files 2020-05-17 17:32:06 +07:00
Leroy Hopson
3307231b65 Enable full codepoint tests if env var set
Full codepoint tests will only be run if the RUN_FULL_CODEPOINT_TESTS
environment variable is set. This is set in the CI enviroment.
The tests take too long to run locally as part of regular test driven
development.
2020-05-14 13:03:18 +07:00
Leroy Hopson
8d76d3500c Update license text in file headers
With the exception of text_decoder.gd the code in these files follows
the original so closely that it doesn't qualify as an original work
and so there is nothing new to copyright.

Instead, the original license text is kept with a note mentioning the
port to GDScript.
2020-05-11 04:05:37 +12:00
Leroy Hopson
96e9ddcf79 Add all the files 2020-05-10 01:42:19 +07:00