diff options
| author | Louis Burda <dev@sinitax.com> | 2026-01-30 22:49:06 +0100 |
|---|---|---|
| committer | Louis Burda <dev@sinitax.com> | 2026-01-30 22:51:59 +0100 |
| commit | 0ff1fafa09eb0af827233d3e0906cf64282d096f (patch) | |
| tree | 3729dbad9023c155115d408a779a5b0210a6e4f9 /attach.sh | |
| download | taketty-main.tar.gz taketty-main.zip | |
Diffstat (limited to 'attach.sh')
| -rwxr-xr-x | attach.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/attach.sh b/attach.sh new file mode 100755 index 0000000..055574a --- /dev/null +++ b/attach.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -z "$TAKETTY_PTY" ]; then + echo "Error: TAKETTY_PTY not set" >&2 + return 1 2>/dev/null || exit 1 +fi + +if [ ! -e "$TAKETTY_PTY" ]; then + echo "Error: $TAKETTY_PTY does not exist" >&2 + return 1 2>/dev/null || exit 1 +fi + +exec 0<>"$TAKETTY_PTY" +exec 1>&0 +exec 2>&0 + +echo "Attached to $TAKETTY_PTY (note: not controlling terminal without attach helper)" |
