[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[modconf] Use `tty` rather than /dev/tty



 The BusyBox `tty' command needs to be built and installed also,
 before this will/should work.


2000-01-25  Karl M. Hegbloom  <karlheg@bittersweet.inetarena.com>

	* modconf (ttydev): Use `tty` to determine what tty it's running
	from.  When /dev/tty is used explictly, and the user switches
	virtual consoles then right after that `modconf' refreshes the
	display, it can fill the screen of the virtual console that is now
	in the foreground.  That is a property of the special /dev/tty
	device. (/dev/tty 5,0, /dev/tty1 4,1)

karlheg@bittersweet:/usr/local/src/PKG/potato/main/modconf-0.2.26.5
% diff -u modconf.orig modconf
--- modconf.orig	Tue Jan 25 19:23:23 2000
+++ modconf	Tue Jan 25 21:36:11 2000
@@ -4,7 +4,11 @@
 x=0
 umask 022
 
-ttydev=/dev/tty
+ttydev=`tty`
+if [ "x$ttydev" = "x" ]; then
+    echo $0: Not a tty! >&2
+    exit 1
+fi
 
 if [ -x /usr/bin/tput ]; then
     readonly bold=`tput bold`
Exit Status: [0]


Reply to: