Re: Minor patch to /etc/profile
Le 01/05/2010 05:25, Chris Sutcliffe a écrit : The PS1 definition for ksh in /etc/profile uses the literal ascii characters '^[' for the escape sequence as opposed to the single byte escape control code. The attached patch corrects that as well as HOSTNAME not being set correctly (at least for mksh). the right way to go would be something like : the current way : PS1=$(print '\033]0;${pwd}\n\033[32m${us...@${hostname} \033[33m${PWD}\033[0m\n$ ') w/ tilde expansion as bash does : TILDE=\~ PS1=$(print '\033]0;${TILDE[(1-0${PWD%%@([!/]*|${HOME}*)}1)]:-}${pwd#${home}}\n\033[32m${us...@${hostname} \033[33m${TILDE[(1-0${PWD%%@([!/]*|${HOME}*)}1)]:-}${PWD#${HOME}}\033[0m\n$ ') so, you can still print the file w/o side effects Regards, Cyrille Lefevre -- mailto:cyrille.lefevre-li...@laposte.net -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Minor patch to /etc/profile
Hi Chris, I'm anticipating to have several hours to do these (and other) changes in the next week or so. Regards, John. On Sat, May 1, 2010 4:25 am, Chris Sutcliffe wrote: > The PS1 definition for ksh in /etc/profile uses the literal ascii > characters '^[' for the escape sequence as opposed to the single byte > escape control code. The attached patch corrects that as well as > HOSTNAME not being set correctly (at least for mksh). > > Finally, would it be appropriate to extend the 'ksh' case to catch > both pdksh as well as mksh? Basically the case would be: > > *ksh* | -*ksh* | */*ksh* | \ > *ksh*.exe | -*ksh*.exe | */*ksh*.exe ) > > Chris > > -- > Chris Sutcliffe > http://emergedesktop.org > http://www.google.com/profiles/ir0nh34d > -- > Problem reports: http://cygwin.com/problems.html > FAQ: http://cygwin.com/faq/ > Documentation: http://cygwin.com/docs.html > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Minor patch to /etc/profile
The PS1 definition for ksh in /etc/profile uses the literal ascii characters '^[' for the escape sequence as opposed to the single byte escape control code. The attached patch corrects that as well as HOSTNAME not being set correctly (at least for mksh). Finally, would it be appropriate to extend the 'ksh' case to catch both pdksh as well as mksh? Basically the case would be: *ksh* | -*ksh* | */*ksh* | \ *ksh*.exe | -*ksh*.exe | */*ksh*.exe ) Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d profile.diff Description: Binary data -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple