Only restore git submodules if we have an exact match, otherwise we will
restore outdated submodules over newer ones, then save the outdated
version with the exact match after.
This method was never officially documented and used only as a workaround for
issue #53. It also returns an instance of the undocumented and scruffily
implemented Pipe class that I would prefer to keep internal.
Now that #53 has been fixed, this method can be removed from the unofficial
public API, but deprecate it just in case. If someone was using it then it
is still possible (although not supported) to access the `_pipe` property of
`_pty_native`.
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.
Changes `write()` method of native pipe and terminal to accept a
PoolByteArray rather than String. This means that `get_string_from_utf8()`
is no longer called on data coming from PTY and being sent to Terminal.
The terminal state machine already has a UTF8 parser which maintains
its state across calls to `write()`. This means that we can write half
the bytes of a single unicode character in one call and the remaining half
in the next call and the state machine will parse it correctly.
On the other hand, the `get_string_from_utf8()` method of Godot's
PoolByteArray requires that the array contains completely valid UTF8,
otherwise we get errors such as "Unicode error: invalid skip".
The data coming from PTY can be arbitrarily split in the middle of a
unicode character meaning that we will sometimes get errors when calling
`get_string_from_utf8()` on it. This is more likely to occur when there
is a large amount of output (i.e. it's more likely to be split). In other
cases, the data might intentionally contain invalid unicode such as when
printing binary files or random data (e.g. `cat /bin/sh`, `cat /dev/random`).
We avoid these errors by passing the PoolByteArray data directly to the terminal
state machine.
In addition to fixing unicode errors, this commit:
- Prevents repeated calls to pipes `_read_cb()` method that would block Godot
and result in a crash with the message "ERROR: All memory pool allocations
are in use" that resulted from writing data to an ever-increasing number of
PoolByteArrays before any of them could be freed. This could be triggered by
running the `cat /dev/urandom` command after making the change to `write()`
mentioned above.
- Prevents memory leaks by freeing libuv buffers after they have been copied
to PoolByteArrays.
Fixes#55.
If a PTY has a terminal_path set to a valid Terminal, then ensure that
the initial cols and rows of PTY match the cols and rows of the Terminal
when calling fork() or open(), otherwise PTY will output wrong-sized
data for the Terminal until resized.
Fixes#56.
Makes it easier to keep documentation up to date and can deploy with
GitHub pages.
README.md moved to docs/README.md and is shared with GitHub Pages home
page.
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.
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.
Fixes error that would sometimes occur when closing the Terminal after
calling write() but before the VisualServer had finished drawing the
current frame.
De-references pty_baton's exit callback after it is called so it can be
automatically released, preventing leaked instances.
Adds basic implementation for Pipe's get_status() method and forces PTY
to wait for child process to exit to ensure exit callback is cleaned up.
Adds a test to check that exit callback is still called as usual.
The type of winsize.ws_col and winsize.ws_row is unsigned short, so
change python's struct.unpack format from 'hh' (short) to 'HH'.
Otherwise, we can only test sizes up to 32767 when actually sizes up to
65535 are supported.
Commit GUT directly to the git repo and remove gd-plug as it is no
longer required to install GUT.
Modify GUT to be used by command-line only.
For example:
```
cp test/.gutconfig.ci.json .gutconfig.json
godot --no-window -s addons/gut/gut_cmdln.gd
```
Often when closing a terminal in the terminal panel the error message
'Condition "!obj" is true.' would be printed to console.
This was due to the call_funcv() method being called on an invalid
FuncRef instance (invalid because it had already been deleted or queued
for delection).
Now we check the instance is valid before calling the method.
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.
Adds support for building Linux binaries inside a docker container in
order to target an older version of GLIBC.
Updates GitHub Actions workflow to use it.
As a result the minimum version of GLIBC that Linux users need to have
installed on their system is 2.17 which was released in 2012.
- windows-latest now uses windows-2022 which has Visual Studio 17 2022.
- Update cmake version from 3.15.4 to 3.23.2 which has generator for the
newer version of Visual Studio.