### Copyright (C) 1996,97 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 promptGen {} { # User<->Bash interface / Prompting / General Desc "This configuration page will help you to setup options related to"\ "prompting." ShortDesc "Prompting--general setup" ### Prompt options ### Header head1 -text "Prompt options"\ -background gray\ -help "Options concerning preprompt commands and how prompt variables are to be handled." Entry promptCommandEntry -text "command"\ -help "A single command to execute. A delimiter (\;) will be added between each command." ExtEntry promptCommand -text "Command(s) to execute before primary prompt"\ -entries {promptCommandEntry}\ -help "Commands listet here will be executed prior to issuing each primary prompt."\ -packFrame:fill x Line line1 CheckBox pvars -text "Expansion of prompting variables"\ -default 1\ -help "If set, prompt strings undergo variable and parameter expansion after being"\ "expanded. This option is chosen by default, and is also why you can display"\ "username, time, date, etc. or contents of other variables in your prompt."\ "(This option is available in Bash version 2.0 only)" ShowPage { if {[set version@bash(index)]} { Enable pvars } { Disable pvars } } Save { set temp "" forevery promptCommand { if {$promptCommandEntry != ""} { append temp "$promptCommandEntry\;" } } set temp [string trim $temp ";"] if {$temp != ""} { print "export PROMPT_COMMAND='$temp'" } { if {$generateDefault} { print "unset PROMPT_COMMAND" } } if {($pvars != 1 || $generateDefault) && [set version@bash(index)]} { print "shopt -[pick $pvars s u] promptvars" } } } proc primprompt {} { # User<->Bash interface / Prompting / Primary prompt Desc "This configuration page will help you"\ "configuring the primary prompt. This is the prompt Bash will print before"\ "reading your commands." ShortDesc "Primary prompt" ### Primary prompt ### promptWidget "%shell%%supusr% " {{Primary prompt} {Setup of options regarding the primary prompt}} Save { if {$prompt != ""} { print "export PS1=\"$prompt\"" } } } proc secprompt {} { # User<->Bash interface / Prompting / Secondary prompt Desc "This configuration page will help you"\ "configuring the secondary prompt. This is the prompt Bash will print if the"\ "commandline is stretched over more than one line." ShortDesc "Secondary prompt" ### Secondary prompt ### promptWidget "> " {{Secondary prompt} {Setup of options regarding the secondary prompt}} Save { if {$prompt != ""} { print "export PS2=\"$prompt\"" } } } proc thrdprompt {} { # User<->Bash interface / Prompting / Prompt 3 Desc "This configuration page will help you"\ "configuring prompt 3. This is the prompt Bash will print when the builtin"\ "command \"select\" is awaiting your choice." ShortDesc "Prompt 3" ### Third prompt ### promptWidget "\#? " {{Prompt 3} {Setup of options regarding the third prompt}} Save { if {$prompt != ""} { print "export PS3=\"$prompt\"" } } } proc frthprompt {} { # User<->Bash interface / Prompting / Prompt 4 Desc "This configuration page will help you"\ "configuring prompt 4. This is the prompt Bash will print when tracing shell"\ "scripts/commands with \"xtrace\" (see User<->Bash interface / Commandline:"\ "Command/script handling)." ShortDesc "Prompt 4" ### Fourth prompt ### promptWidget "+" {{Prompt 4} {Setup of options regarding the fourth prompt}} Save { if {$prompt != ""} { print "export PS4=\"$prompt\"" } } }