Add option --raw/--raw-interactive and Ctrl-t j/J subcommand

Non-interactive operations (input from a pipe, running a shell command,
XYMODEM transfers) often fail when mapping, soft flow control, or output
delay are enabled.

To reduce the hassle of switching settings, add the function shown in
the title.

The raw option can be set to one of the following:
- off ... no effects
- on ... soft-flow off, character mapping off, output delay enabled
- on-nodelay ... soft-flow off, character mapping off, output delay
disable

raw option is for Piped-input / Shell command execution / XYMODEM
transfering. default is on.
raw-interactive option is for socket-mode and normal terminal use.
default is off.

You can type Ctrl-t j if you need to change raw setting for
non-interactive case. it toggles the raw setting.

You can type Ctrl-t J if you need to change raw setting of interactive
case. it toggles the raw setting.
It is useful when transferring files in socket mode.
This commit is contained in:
yabu76 2026-01-17 11:41:10 +09:00
parent 3b7fe3d258
commit 321494b4e6
7 changed files with 357 additions and 102 deletions

View file

@ -69,8 +69,18 @@ typedef struct
bool reserved;
} tty_line_config_t;
typedef enum
{
STATE_INTERACTIVE,
STATE_STARTING,
STATE_PIPED_INPUT,
STATE_EXEC_SHELL_COMMAND,
STATE_XYMODEM,
} state_t;
extern const char *device_name;
extern bool interactive_mode;
extern state_t state;
void stdout_configure(void);
void stdin_configure(void);
@ -88,3 +98,4 @@ GList *tty_search_for_serial_devices(void);
void forward_to_tty(int fd, char output_char);
ssize_t tty_write(int fd, const void *buffer, size_t count);
void tty_sync(int fd);
int tty_tcsetattr(int fd);