Spawning a TTY shell upgrades a basic shell into a fully interactive terminal, enabling features like job control and better command execution.

Python

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.

Link to original

# Works with both Python2 and Python3
python3 -c 'import pty;pty.spawn("/bin/bash")'
 
# Background the shell (Ctrl + Z), then run:
stty raw -echo; fg  # Press [Enter] twice
export TERM=xterm

Script

Script makes a typescript of everything printed on your terminal.

script -qc /bin/bash /dev/null
 
# Background the shell (Ctrl + Z), then run:
stty raw -echo; fg  # Press [Enter] twice
export TERM=xterm