1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
### Copyright (C) 1996 Per Zacho
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
proc ttyApp {} {
# User<->Bash interface / TTY appearance
Desc "This configuration page will help you to setup screen appearance,"\
"i.e. screen width and height, bell style, etc."
ShortDesc "TTY appearance"
### TTY related information ###
Header head1 -text "TTY related information"\
-background gray\
-help "TTY is an abbreviation for Teletype (tm)Teletype Corp. TTY has"\
"come to mean any terminal."
Label label1 -text "Dimensions of character terminal"\
-help "When using a non-character (graphic) terminal--like X windows, these"\
"variables are of less interest. Actually the X window system"\
"adjust these variables according to the actual size of xterm window."
Int col -text "Screen width"\
-help "Set the screen width. This information is mainly used in connection"\
"with character based terminals--not X windows."
Int lin -text "Screen height"\
-help "Set the screen height. This information is mainly used in connection"\
"with character based terminals--not X windows."
Frame frame1 -entries {col lin}\
-orient left\
-default {80 24}
CheckBox chkWinSize -text "Automatic update of width/height"\
-help "If set, bash checks the window size after each command and, if"\
"necessary, updates the values of LINES and COLUMNS. (This option is"\
"available in Bash version 2.0 only)"\
-default 0
Line line1
Radio scroll -text "If commandline exceeds screen width..."\
-defaultIndex 0\
-entryhelp {"wrap onto new line" "Wrap the line onto a new screen line."\
"scroll horizontally" "Scroll horizontally to make room for more."}\
-help "This option enables you to choose how the commandline"\
"will react when you type beyond the right-hand side of the screen."\
-packFrame:fill x
Line line2
Radio bell -text "Bell type"\
-defaultIndex 1\
-entryhelp {"none (disabled)" "Never ring the bell."\
"audible" "Use computer bell (beep)."\
"visible" "Use, if possible, visual bell (flash screen)."}\
-help "This option enables you to choose how the command editor"\
"will inform you of errors or similar (where bell is used). The audible bell (beep) is"\
"default."\
-packFrame:fill x
Line line3
CheckBox meta -text "Allow 8-bit characters in commandlines"\
-default 0\
-help "Is Bash to allow eight-bit characters in commands. If you are"\
"using characters, which are not included in the \"standard\" a to z, you"\
"should enable this option."
CheckBox convert -text "Convert 8-bit characters to ESC sequences"\
-default 1\
-help "When the shell encounters eight-bit characters, it will strip"\
"the eigth bit, and prefix an ESC character."
CheckBox output -text "Display 8-bit characters"\
-default 0\
-help "Display eight-bit characters on terminal."
ShowPage {
if [set version@bash(index)] {
Enable chkWinSize
} {
Disable chkWinSize
}
}
Change {
if {$chkWinSize} {
Disable frame1
} {
Enable frame1
}
}
PageEnd {
if {$col < 1 || $lin < 1} {
error "Screen dimensions are always nonzero, positive integers."
}
}
Save {
### TTY related information ###
if {$chkWinSize || $generateDefault} {
print "shopt -[pick $chkWinSize s u] checkwinsize"
}
if {($col != 80 || $generateDefault) && $chkWinSize == 0} {
print "export COLUMNS=$col"
}
if {($lin != 24 || $generateDefault) && $chkWinSize == 0} {
print "export LINES=$lin"
}
if {$scroll(index) || $generateDefault} {
print -file inputrc "set horizontal-scroll-mode [pick $scroll(index) on off]"
}
if {$bell(index) != 1 || $generateDefault} {
set temp "set bell-style"
switch $bell(index) {
0 {lappend temp "none"}
1 {lappend temp "audible"}
2 {lappend temp "visible"}
}
print -file inputrc $temp
}
if {$meta || $generateDefault} {
print -file inputrc "set meta-flag [pick $meta on off]"
}
if {$convert == 0 || $generateDefault} {
print -file inputrc "set convert-meta [pick $convert on off]"
}
if {$output || $generateDefault} {
print -file inputrc "set output-meta [pick $output on off]"
}
}
}
|