16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26
27 #
28 # This file is sourced by interactive ksh93 shells before ${HOME}/.kshrc
29 #
30
31 # Enable "gmacs"+"multiline" editor mode if the user did not set an
32 # input mode yet (for example via ${EDITOR}, ${VISUAL} or any
33 # "set -o" flag)
34 if [[ "$(set +o)" != ~(Er)--(gmacs|emacs|vi)( .*|) ]] ; then
35 set -o gmacs
36 # enable multiline input mode
37 set -o multiline
38 # enable globstar mode (match subdirs with **/)
39 set -o globstar
40 fi
41
42 # Set a default prompt (<username>@<hostname>:<path><"($|#) ">) if
43 # then variable does not exist in the environment.
44 #
45 # Algorithm:
46 # 1. Define "ellipsis", either Unicode #2026 for unicode locales
47 # and "..." otherwise
48 # ([[ "${LC_ALL}/${LANG}" = ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]]
49 # ensures that the pattern matches the leftmost sequence
50 # containing *.UTF-8, allowing to match either LC_ALL or
51 # LANG when LC_ALL is not set)
52 # 2. If PWD is within HOME replace value of HOME with '~'
53 # If the PWD is longer than 30 charatcers shorten it to 30 chars
54 # print '#' for user "root" and '$' for normal users
55 # Notes:
56 # - printf "%*s\r%s" COLUMNS "") # is used at the beginning to
57 # work around a bug in the "multiline" handling code which
58 # causes the shell to override its own prompt when the edit
59 # line overflows (this happens if the terminal cursor
60 # position is not 0 when PS1 is printed).
|
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26
27 #
28 # This file is sourced by interactive ksh93 shells before ${HOME}/.kshrc
29 #
30
31 # Enable "gmacs"+"multiline" editor mode if the user did not set an
32 # input mode yet (for example via ${EDITOR}, ${VISUAL} or any
33 # "set -o" flag)
34 if [[ "$(set +o)" != ~(Er)--(gmacs|emacs|vi)( .*|) ]] ; then
35 set -o gmacs
36 fi
37 # enable multiline input mode
38 set -o multiline
39 # enable globstar mode (match subdirs with **/)
40 set -o globstar
41
42 # Set a default prompt (<username>@<hostname>:<path><"($|#) ">) if
43 # then variable does not exist in the environment.
44 #
45 # Algorithm:
46 # 1. Define "ellipsis", either Unicode #2026 for unicode locales
47 # and "..." otherwise
48 # ([[ "${LC_ALL}/${LANG}" = ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]]
49 # ensures that the pattern matches the leftmost sequence
50 # containing *.UTF-8, allowing to match either LC_ALL or
51 # LANG when LC_ALL is not set)
52 # 2. If PWD is within HOME replace value of HOME with '~'
53 # If the PWD is longer than 30 charatcers shorten it to 30 chars
54 # print '#' for user "root" and '$' for normal users
55 # Notes:
56 # - printf "%*s\r%s" COLUMNS "") # is used at the beginning to
57 # work around a bug in the "multiline" handling code which
58 # causes the shell to override its own prompt when the edit
59 # line overflows (this happens if the terminal cursor
60 # position is not 0 when PS1 is printed).
|