cd "$(cat /path-to-session/SESSION_demo/main/pwd)"
history -c
history -r /path-to-session/SESSION_demo/main/history

VAR="`history 1 | sed -n '1 { p; q; }' | awk '{ print \$1; }'`" ; \
history -d $VAR ; \
yes '' | head -c1100 ; \
clear ; \
cat /path-to-session/SESSION_demo/main/scrollback | \
sed ':a;N;$!ba;s/^\n\+//;s/\n\+$//' - | \
sed '$ d;' -
