Page 1 of 1

TTY respawning

Posted: Sun Oct 12, 2008 11:37 pm
by Jim
on fedora core 9, when you logout the scrollback buffer isn't cleared...this could potentially be a problem. I found this really cool script that will clear the virtual terminal, switch terminals and then switch back; effectively clearing the buffer. The problem with this is, every once in a while the virtual terminal won't respawn so instead of a "localhost login:" there's just a blank screen and i have to alt + f2 to another VT to login. Is there something wrong with this perl script or possibly a better way to clear the VT and the scrollback? btw...this is in the ~/.bash_logout file.

Code: Select all

case "`tty`" in
  /dev/tty[0-9]*)
	CUR_CONSOLE=`fgconsole`
	clear
	chvt 63
	chvt "$CUR_CONSOLE"
   ;;
esac