From a3a5564d7d5b09642e2beeebeabb57716e9e84fa Mon Sep 17 00:00:00 2001 From: sirdude Date: Thu, 9 Apr 2009 19:53:14 +0000 Subject: [PATCH] This is a patch by John Tseng, It adds the ability to support Dynamic columns using stty you just setenv DYNAMIC_COLUMNS 1 and it will start using them. Kent --- tcl/modulecmd.tcl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tcl/modulecmd.tcl b/tcl/modulecmd.tcl index 0fd2bd19..bc82e729 100755 --- a/tcl/modulecmd.tcl +++ b/tcl/modulecmd.tcl @@ -18,6 +18,16 @@ set flag_default_dir 1 ;# Report default directories set flag_default_mf 1 ;# Report default modulefiles and version alias set g_def_seperator ":" ;# Default path seperator +# Dynamic column +if {[info exists env(DYNAMIC_COLUMNS)]} { # do dynamic columns? + # yes, read the stty size size information and reset DEF_COLUMNS + set stty_output [exec stty size] + if {$stty_output != ""} { + set dynamic_column [lindex $stty_output 1] + set DEF_COLUMNS $dynamic_column + } +} + # Change this to your support email address... set contact "root@localhost" @@ -2846,7 +2856,7 @@ proc cmdModuleHelp {args} { } if {$done == 0} { report "Modules Release Tcl $MODULES_CURRENT_VERSION " 1 - report {($RCSfile: modulecmd.tcl,v $ $Revision: 1.120 $)} + report {($RCSfile: modulecmd.tcl,v $ $Revision: 1.121 $)} report { Copyright GNU GPL v2 1991} report {Usage: module [ command ]}