Add bidirectional redirection to shell command execution function (Ctrl-t R and --exec option)

The "shell command execution feature" previously only supported the
ability to transfer a command's stdout and stderr to a device.

To support bidirectional commands, a feature will be added to connect
input from a device to the command's stdin.

Since some communication commands (sz, rz) require stderr to be kept
local, a feature will also be added to not transfer stderr to a device
if the command string begins with a '?'.

On Linux, you can terminate a running command by pressing Ctrl-t R again
while the command is running (this uses the command /usr/bin/pkill
internally).
This commit is contained in:
yabu76 2026-01-18 15:39:12 +09:00
parent 321494b4e6
commit 445a21b807
4 changed files with 131 additions and 22 deletions

View file

@ -38,3 +38,7 @@ double get_current_time(void);
bool match_patterns(const char *string, const char *patterns);
int execute_shell_command(int fd, const char *command);
void clear_line();
#if defined(__linux__)
void terminate_shell_command(void);
#endif