Tool for executing a command in a new PTY (pseudo-terminal) with new PGID and SID
- Download the latest revision:
git clone https://github.com/VHSgunzo/ptyspawn.git && cd ptyspawn
- Build:
make
-
Or take an already precompiled binary file from the releases
-
Usage:
./ptyspawn [ -vhV ] command {command args}
-h Print this help
-V Verbose
-v Version
- You can also start a new session with logging to a file:
./ptyspawn command {command args} | tee /path/to/file.log
- Features:
- Spawn new full PTY session
- Set new PGID and SID
- Dynamically changing the size of the terminal along with the size of the window
- Return the execution code when exiting
- Exported environment variables:
PTYSPAWN_PTY
- Slave PTY(/dev/pts/X)
PTYSPAWN_PID
- Self process id