3 ms·
I wrote a script bash-for-recording for myself a few years back, for invocation by termrec, which set the window size to 80×24, set HOME to a new empty director
by chrismorgan 9y ago
I wrote a script bash-for-recording for myself a few years back, for invocation by termrec, which set the window size to 80×24, set HOME to a new empty directory, set USER and NAME to dummy values (creating an actual new throwaway user account would be better here, but I was lazy), set TERM to xterm-256color (I think it was), cleared the environment (env -i) and possibly one or two other things, set a deliberately very simple and obvious prompt (which sets the title as well), cleared the screen, then finally started a nice clean bash profile.
I should pull out my old laptop or my backups and resuscitate the script.
The example at http://tty-player.chrismorgan.info/ http://tty-player.chrismorgan.info/ was generated using that script.
- NetOpWibby 9y agoThis is neat! Thanks for sharing.
- chrismorgan 9y agoI remembered a couple of details incorrectly, but this was my bash-for-recording script: #!/bin/bash # Start a new bash shell with a severely filtered environment and no initfile. if [ -z "$_BFR_RUNNING" ]; then env -i \ _BFR_RUNNING=1 \ PATH="$PATH" \ LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ TERM="$TERM" \ SHELL="$SHELL" \ USER="$USER" \ HOME="$HOME/bfr-home" \ LANG="$LANG" \ bash --init-file "$0" "$@" <&0 exit $? else unset _BFR_RUNNING fi # What remains of this file is the initfile. USER=user HOSTNAME=hostname PS1='\n\[\033[32;45;1m\]\w\[\033[m\]\$ ' eval "$(dircolors -b)" alias ls='ls --color=auto'