This is a script to split window for the shell lesson.
Under MIT.
$ ./swc-shell-split-window.sh
Various environment variables affect the behaviour of the script, these are:
SESSION
: The name of the session (default: swc)LOG_FILE
: The location where the log file will be stored (default: /tmp/swc-split-log-file)HISTORY_LINES
: How many lines of history to be shown (default: 5)BGCOLOR
: Background colour of the sessionThese can be used with, e.g.:
LOG_FILE=/tmp/log HISTORY_LINES=10 ./swc-shell-split-window.sh
To enable mouse scrolling of the output edit $HOME/.tmux.conf
to include the
line:
setw -g mouse on
You may wish to set the background color of a session in case you have to role play to different people. This comes in handy if, for instance, you are teaching about Git Conflicts.
To do so, you would want to start to sessions in separate terminal windows with, e.g.:
SESSION=swc1 BGCOLOR=12 ./swc-shell-split-window.sh
SESSION=swc2 BGCOLOR=90 ./swc-shell-split-window.sh
You can print all the available colours using:
for i in {0..255}; do
printf "\x1b[38;5;${i}mcolour${i}\x1b[0m\n"
done