Search this site

Metadata

Articles

Projects

Presentations

Slight update.. ksh prompt

Found a few issues with the latest changes I made to my ksh prompt...

[ -w "/" ] && Z="#" || Z=">"; export Z
PROMPT='$(A=$?; /bin/echo -n $HOST"("`/bin/pwd | /usr/bin/sed -Ee "s,(/usr)?$HOME,~,"`") [!] "$([ $A -ne 0 ] && /bin/echo -n "!!${A}!! ")$Z" " )'
XTERM=
case $TERM in
   aterm|xterm|dtterm)
      XTERM='$(echo -n "\033]2;'${PROMPT%%$Z*}')\007" 1>&2)'
      ;;
   esac
export PS1=$XTERM$PROMPT

Keep in mind that PROMPT is very long...
Previously, it didn't report exit codes due to kludges that made $? change to 0 due to the exit status of some of the crap that runs inside the prompt.

Huzzah. However, on a sad note I'll point out the obnoxious length of PS1 now...

nightfall(~) [569] > echo "${#PS1}"
257

0 responses to 'Slight update.. ksh prompt'

Showing last 0 comments... (Click here to view all comments)


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment: