SSH like functions, preffered method of upgrading the shell
# Spawn Python shellpython-c'import pty; pty.spawn("/bin/bash")'# Background the shellCtrl+Z# Get current Rows and Columnsstty-a|head-n1|cut-d';'-f2-3|cut-b2-|sed's/; /\n/'# Bring shell back to the foregroundsttyraw-echo; fg# Set size for the remote shell # (where ROWS and COLS are the values from the 3rd command)sttyrowsROWScolsCOLS# Add some coloursexport TERM=xterm-256color# Reload bash to apply the TERM variableexec/bin/bash
Spawn TTY Shell #2
Similar to above, slightly less function but easier to implement.
# Spawn Python shellpython -c 'import pty;pty.spawn("/bin/bash")'# Give terminal functionsexport TERM=xterm# Background the shellCtrl + Z# Bring shell back to the foreground stty raw -echo; fg