_bash_profile_addpath: Final workaround for $OPTIND breakage.
authorshort <>
Sun, 26 Dec 2004 18:49:25 +0000 (18:49 +0000)
committershort <>
Sun, 26 Dec 2004 18:49:25 +0000 (18:49 +0000)
Fix unicode keyboard+PS1 settings.

.bashrc

diff --git a/.bashrc b/.bashrc
index b1eaeeb..432ac97 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -17,10 +17,12 @@ if [ -f /etc/bashrc ];then source /etc/bashrc;fi
 
 function _bash_profile_addpath # <variablename>,<dirpathname>
 {
-       local OPTIND
+       # FIXME: local OPTIND
+       # see also: <20041223083747.GA9955@kobhome.dyn.jankratochvil.net>
+       unset OPTIND
        local _varname _dirpathname _opt_f _opt_s
        _opt_f=0;_opt_s=0
-       OPTIND=1;while getopts fs got;do
+       while getopts fs got;do
                case "$got" in
                        [fs]) eval "_opt_$got=1" ;;
                        *) return 1 ;;
@@ -128,9 +130,10 @@ for file in $HOME/.bookmarks.html;do
 export GREP_OPTIONS="--binary-files=without-match --directories=skip"
 if [ -n "$PS1" ];then  # set only in interactive sessions
        export PS1='[bash]${LOGNAME}@${HOSTNAME}:${PWD}# '
-       kbd_mode -u     # utf-8
-       export PS1='\[\017\033%G\]'"$PS1"       # \017=std charmap, \033%G=utf-8
-       # export PS1='\[\017\]'"$PS1"   # \017=std charmap
+       export PS1='\[\017\]'"$PS1"     # \017=std charmap
+       export PS1='\[\033%G\]'"$PS1"   # \033%G=utf-8
+       # Do not: kbd_mode -u # utf-8
+       # as it breaks keyboard state in X and it is not permitted for non-root.
        fi
 export MINICOM="-m -c on"      # metakeys+color
 export HISTSIZE=100000
@@ -192,6 +195,7 @@ function revlines { perl -e 'my @r=();push @r,$_ while (<>);print pop @r while @
 ulimit -c 0
 set +H
 shopt -s mailwarn
+unset OPTIND   # FIXME; see also: <20041223083747.GA9955@kobhome.dyn.jankratochvil.net>
 
 if [ -f "$HOME/.bashrc.local" ];then source "$HOME/.bashrc.local";fi