Skip to content

Tool for executing a command in a new PTY (pseudo-terminal) with new PGID and SID

License

Notifications You must be signed in to change notification settings

VHSgunzo/ptyspawn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ptyspawn

Tool for executing a command in a new PTY (pseudo-terminal) with new PGID and SID

To get started:

  • 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