-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash -x | ||
|
||
SOCKDIR=$(mktemp -d) | ||
SOCKF=${SOCKDIR}/usock | ||
|
||
# Start tmux, if needed | ||
tmux start | ||
# Create window | ||
tmux new-window "socat UNIX-LISTEN:${SOCKF},umask=0077 file:\`tty\`,raw,echo=0" | ||
# Wait for socket | ||
while test ! -e ${SOCKF}; do sleep 1; done | ||
SOCAT_TTY=$(tty) | ||
|
||
# space for no history, gitar shortcut | ||
echo " $(gitar --dry-run -e -p 9292)" > ${SOCAT_TTY} | ||
echo " clear" > ${SOCAT_TTY} | ||
|
||
# Use socat to ship data between the unix socket and STDIO. | ||
exec socat file:${SOCAT_TTY},raw,echo=0 UNIX-CONNECT:${SOCKF} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters