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]\$ "
>
> all produce the same thing, which leaves the issue even more confused
> than when we started.

That's unsurprising because they're all the same (you're setting all
your text to bold, including what you type).


Re: EPEL and revisions

2017-11-11 Thread ToddAndMargo

On 11/11/2017 06:28 AM, Nico Kadel-Garcia wrote:

In my experience, Nux! will respond to a request in a couple
of days.  If RHEL does respond, it will be in a couple of years.
Nux! is the best bet.

Who is "Nux!" ?


https://li.nux.ro/


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 than when 
we started.


{^_^}


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 confused.


Back with Hurricane, I think it was, I simply built an alias for that stty 
command and called it "clr". I "think" the \e[0m cured the screwed up text. At 
the very least I've not had it happen to me in a VERY long time.


{^_^}


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}
== 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\
[\033[01;34m\] \w \$\[\033[00m\] "


If you use single-quotes for PS1, you can use unescaped double-quotes
and dollar signs within it. It makes it more legible:

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;31m\]\h"; else echo "\[\033[01;32m\]\u@\h";
fi)\[\033[01;34m\] \w \$\[\033[00m\] '

You might be better off using "printf" (it's a bash builtin) because
"echo" might not interpret escapes depending on the bash or shell
options that are set.


It works for him, apparently. So that's good. Now, in pedantic mode each of the 
\033 strings can be changed to \e for easier readability.


{^_-}


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 
> 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 ]

And *this* is why I ignore it all and just use "stty sane" when my
console gets confused.

heh - personally, I just type: reset

--
Steven Haigh

 net...@crc.id.au    http://www.crc.id.au
 +61 (3) 9001 6090 0412 935 897


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* is why I ignore it all and just use "stty sane" when my
> console gets confused.

"ssty sane"
"reset"
"printf \033c"

Prefixed with a linefeed ("ctrl-j") so as to ensure that the actual
command doesn't start with any of the previous garbage.


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 ]
>>
>> And *this* is why I ignore it all and just use "stty sane" when my
>> console gets confused.
>
> heh - personally, I just type: reset
>
> --
> Steven Haigh

Coming from Unix System III, of many, many, years ago, my "magic
incantation" is just that prefixed and suffixed by .

I.e.: reset

Alan.


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 "stty sane" when my
> console gets confused.

heh - personally, I just type: reset

-- 
Steven Haigh

 net...@crc.id.au    http://www.crc.id.au
 +61 (3) 9001 6090 0412 935 897

signature.asc
Description: This is a digitally signed message part.


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: EPEL and revisions

2017-11-11 Thread Nico Kadel-Garcia
On Fri, Nov 10, 2017 at 5:26 PM, ToddAndMargo  wrote:
> Dear List,
>
> I learned something I did not realize about EPEL
> (Extra Packages for Enterprise Linux):
>
>
> https://fedoraproject.org/wiki/EPEL#What_is_Extra_Packages_for_Enterprise_Linux_.28or_EPEL.29.3F
>
> "EPEL packages are usually based on their Fedora counterparts
>  and will never conflict with or replace packages in the base
>  Enterprise Linux distributions."
>
> So basically, if you need something fixed or updated that is
> already in RHEL, EPEL will not update beyond RHEL.

Our friends over at RHEL do provide newer versions of components. They
put them in the software collections libraries, so that they're
parellel to but carefully do not replace the standard versions.This
includings leading, and bleeding versions, of Python, MySQL, MariaDB,
The "yum-software-collections" package gives pretty good yum based
access to those. They work, and I've personally published several
hundred RPM's using that structure to publish packages that would
overlapped with system libraries.

RPMforge, aka repoforge, used to publish newer versions of upstream,
RHEL published components. But it's a *lot* of work: I used to publish
"subversion" and HylaFAX updates over  there, before Dag Weiers
stepped away and Repoforge went idle, and the dependency tree was
getting unreasonably long. Same with Samba: Backporting it to RHEL, or
to Scientific Linux which I used to do as a hobby, got out of hand
when it became dependent on a newer version of "gnutls" to support
full Active Directory capability, and replacing *that* would break a
lot of software.

They even publish parallel versions of libraries like openssl, to
support older and newer software. It is useful, but it's not "free as
in beer": it takes time and effort. Basically, I think that your
concerns about RHEL, and in turn Scientific Linux and CentOS, lacking
newer components, is misplaced.

Perl version 6, which you're very excited by, oh boy. I'm staring at
www.perl.org, which states "Perl 6 is a sister language, part of the
Perl family, not intended as a replacement for Perl 5, but as its own
thing". What that means... well, that needs to be left to the
imagination of the developers, because it's apparently not going to
replace *anything* written in Perl 5..

> And if you really, really need something fixed, you are at
> the mercy of RHEL or you  have to ask Nux!, who is a
> blooming genius that this kind of thing.

Or you pay RHEL to spend the time debugging or supporting new
features, which is their business, or you write the code and publish
it and share it under the ideally free software licensing so the
features and fixes get published.  All of that is occurring, with
Fedora and EPEL and with CERN through Scientific Linux. If you're
expecting paid, professional levels of integration, testing, and
support, well, engineers need to eat too.

> In my experience, Nux! will respond to a request in a couple
> of days.  If RHEL does respond, it will be in a couple of years.
> Nux! is the best bet.

Who is "Nux!" ?


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;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\
> [\033[01;34m\] \w \$\[\033[00m\] "

If you use single-quotes for PS1, you can use unescaped double-quotes
and dollar signs within it. It makes it more legible:

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;31m\]\h"; else echo "\[\033[01;32m\]\u@\h";
fi)\[\033[01;34m\] \w \$\[\033[00m\] '

You might be better off using "printf" (it's a bash builtin) because
"echo" might not interpret escapes depending on the bash or shell
options that are set.


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. (He way helping me do a binary
>> read from the keyboard.)
>>
>> stty sane^j
>>
>> Note: it is , not "enter".
>
> Make "\033]0;" the first bit of your prompt. Never
> worry about it again.
>
> ESC-0 sets the terminal to have no attribute bits
> set. So it clears funny display. I've had that as
> a standard part of my prompts for decades, even
> back in the CP/M days.

It's "\033[0m" that resets attributes not "\033]0;".

"\033]0;" sets the xterm window title and the xterm icon name to the
text that follows (up until "\007").