Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Tom H
On Sat, Nov 11, 2017 at 1:34 PM, jdow wrote: > On 2017-11-11 04:26, Tom H wrote: >> >> So it should be: >> >> PS1="\[\e[0m\][\u@\h:\l \w]\$ " > > Maybe. I got silly and experimented. > > PS1="\[\e[1m\][\u@\h:\l \w]\$ " > and > PS1="\e[1m[\u@\h:\l \w]\$ " > and > PS1="\e[1m[\\u@\\h:\\l \\w]\$ " > >

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread jdow
On 2017-11-11 04:26, Tom H wrote: So it should be: PS1="\[\e[0m\][\u@\h:\l \w]\$ " Maybe. I got silly and experimented. PS1="\[\e[1m\][\u@\h:\l \w]\$ " and PS1="\e[1m[\u@\h:\l \w]\$ " and PS1="\e[1m[\\u@\\h:\\l \\w]\$ " all produce the same thing, which leaves the issue even more confused t

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread jdow
On 2017-11-11 06:30, Nico Kadel-Garcia wrote: On Sat, Nov 11, 2017 at 8:10 AM, Tom H wrote: [ Hundreds of lines of fine-tuning prompt manipulation code and theory snipped, especially involving quote handling ] And *this* is why I ignore it all and just use "stty sane" when my console gets

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread jdow
On 2017-11-11 03:28, Tom H wrote: On Fri, Nov 10, 2017 at 10:15 PM, Steven Haigh wrote: For what its worth, I've been using this for years: PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\] \342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} =

Re: [EXTERNAL] Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread ONeal, Miles
Or just “reset”. -Miles On Nov 11, 2017, at 08:33, Steven Haigh mailto:net...@crc.id.au>> wrote: On Sunday, 12 November 2017 1:30:45 AM AEDT Nico Kadel-Garcia wrote: On Sat, Nov 11, 2017 at 8:10 AM, Tom H mailto:tomh0...@gmail.com>> wrote: [ Hundreds of lines of fine-tuning prompt manipulatio

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Tom H
On Sat, Nov 11, 2017 at 9:30 AM, Nico Kadel-Garcia wrote: > On Sat, Nov 11, 2017 at 8:10 AM, Tom H wrote: > [ Hundreds of lines of fine-tuning prompt manipulation code and theory > snipped, especially involving quote handling ] Hundreds?! Hopefully someone find them useful! > And *this*

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Alan Bartlett
On 11 November 2017 at 14:33, Steven Haigh wrote: > On Sunday, 12 November 2017 1:30:45 AM AEDT Nico Kadel-Garcia wrote: >> On Sat, Nov 11, 2017 at 8:10 AM, Tom H wrote: >> >> [ Hundreds of lines of fine-tuning prompt manipulation code and theory >> snipped, especially involving quote handling ]

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Steven Haigh
On Sunday, 12 November 2017 1:30:45 AM AEDT Nico Kadel-Garcia wrote: > On Sat, Nov 11, 2017 at 8:10 AM, Tom H wrote: > > [ Hundreds of lines of fine-tuning prompt manipulation code and theory > snipped, especially involving quote handling ] > > And *this* is why I ignore it all and just use

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Nico Kadel-Garcia
On Sat, Nov 11, 2017 at 8:10 AM, Tom H wrote: [ Hundreds of lines of fine-tuning prompt manipulation code and theory snipped, especially involving quote handling ] And *this* is why I ignore it all and just use "stty sane" when my console gets confused.

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Tom H
On Fri, Nov 10, 2017 at 10:41 PM, jdow wrote: > So I went through some documentation. Now I am back up to speed for > ANSI escape sequences and the theoretical interaction of > PROMPT_COMMAND and PS1. PROMPT_COMMAND is run then PS1 is displayed. > PROMPT_COMMAND already has the \e0m in it. \e is

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Tom H
On Fri, Nov 10, 2017 at 9:48 PM, jdow wrote: > > Here is what I have in my .bash_profile file: > > if [ "$PS1" ]; then > # extra [ in front of \u unconfuses confused Linux VT parser > PS1="\e[0 [[\\u@\\h:\\l \\w]\\$ " > fi What do you mean by "VT parser"? Because whether you are on a VT or in an

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Tom H
On Fri, Nov 10, 2017 at 10:15 PM, Steven Haigh wrote: > > For what its worth, I've been using this for years: > PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\] > \342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} > == 0 ]]; then echo '\[\033[01

Re: Tip: when your terminal gets all screwed up

2017-11-11 Thread Tom H
On Fri, Nov 10, 2017 at 7:21 PM, jdow wrote: > On 2017-11-10 15:14, ToddAndMargo wrote: >> >> Ever cat a binary file by accident and your >> terminal gets all screwed up. >> >> I had a developer on the Perl 6 chat line give me >> a tip on how to unscrew your terminal and set it >> back to normal.

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread jdow
On 2017-11-10 19:15, Steven Haigh wrote: On Saturday, 11 November 2017 1:48:23 PM AEDT jdow wrote: On 2017-11-10 16:38, ToddAndMargo wrote: On 11/10/2017 04:21 PM, jdow wrote: On 2017-11-10 15:14, ToddAndMargo wrote: Dear List, Ever cat a binary file by accident and your terminal gets all sc

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread Steven Haigh
On Saturday, 11 November 2017 1:48:23 PM AEDT jdow wrote: > On 2017-11-10 16:38, ToddAndMargo wrote: > > On 11/10/2017 04:21 PM, jdow wrote: > >> On 2017-11-10 15:14, ToddAndMargo wrote: > >>> Dear List, > >>> > >>> Ever cat a binary file by accident and your > >>> terminal gets all screwed up. >

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread ToddAndMargo
On 11/10/2017 06:48 PM, jdow wrote: On 2017-11-10 16:38, ToddAndMargo wrote: On 11/10/2017 04:21 PM, jdow wrote: On 2017-11-10 15:14, ToddAndMargo wrote: Dear List, Ever cat a binary file by accident and your terminal gets all screwed up. I had a developer on the Perl 6 chat line give me a t

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread jdow
On 2017-11-10 16:38, ToddAndMargo wrote: On 11/10/2017 04:21 PM, jdow wrote: On 2017-11-10 15:14, ToddAndMargo wrote: Dear List, Ever cat a binary file by accident and your terminal gets all screwed up. I had a developer on the Perl 6 chat line give me a tip on how to unscrew your terminal an

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread jdow
ds 2017 Edition -Original Message- From: owner-scientific-linux-us...@listserv.fnal.gov [mailto:owner-scientific-linux-us...@listserv.fnal.gov] On Behalf Of jdow Sent: Friday, November 10, 2017 7:22 PM To: scientific-linux-users@fnal.gov Subject: Re: Tip: when your terminal gets all s

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread ToddAndMargo
On 11/10/2017 04:21 PM, jdow wrote: On 2017-11-10 15:14, ToddAndMargo wrote: Dear List, Ever cat a binary file by accident and your terminal gets all screwed up. I had a developer on the Perl 6 chat line give me a tip on how to unscrew your terminal and set it back to normal.  (He way helping

RE: Tip: when your terminal gets all screwed up

2017-11-10 Thread Carl Friedberg
users@fnal.gov Subject: Re: Tip: when your terminal gets all screwed up On 2017-11-10 15:14, ToddAndMargo wrote: > Dear List, > > Ever cat a binary file by accident and your > terminal gets all screwed up. > > I had a developer on the Perl 6 chat line give me > a tip on how to

Re: Tip: when your terminal gets all screwed up

2017-11-10 Thread jdow
On 2017-11-10 15:14, ToddAndMargo wrote: Dear List, Ever cat a binary file by accident and your terminal gets all screwed up. I had a developer on the Perl 6 chat line give me a tip on how to unscrew your terminal and set it back to normal.  (He way helping me do a binary read from the keyboard