Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Joerg Schilling
Martin Vaeth  wrote:

> Joerg Schilling  wrote:
> >
> > bash vs. POSIX, as bash tried to ignore long existing
> > rules just because the bash maintainer did not understand them.
>
> Are there really several? I know only one such example:

One is that "sh -ce cmd" did not exit on error for some kind of commands.
This is where I have been able to convince the bash maintainer together with 
David Korn for bash-4.0. This was a nightmare for make.

Another is e.g. that bash makes job control for commands in scripts or commands 
from "sh -ce cmd". This is another nightmare for make, as this prevents layered 
makefiles from terminating when ^C is typed as some comands run in different 
process groups. Smake for this reason has a special autoconf test for /bin/sh 
being bash and tries to manually kill(2) the dependencies if they are run by 
bash.

> bash insists on compound commands ("{ ... }" or "( ... )")
> for the function body while according to POSIX also
> non-compound commmands can form the body, e.g.
>
> hello() echo "hello world"
>
> is a valid function definition according to POSIX
> (and thus works in dash or also zsh) but not in bash:
> Rumors say that the bash maintainer intentionally
> excluded this due to some misinterpretation of the
> POSIX formulation.


This is valid in the Bourne Shell already, so it is something that can be seen 
as very basic.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Joerg Schilling
Martin Vaeth  wrote:

> Joerg Schilling  wrote:
> > Martin Vaeth  wrote:
> >>
> >> This is not true, either: Although finally bash took some of the
> >> features of zsh (arrays, regular expression matching, etc.) there
> >> are still many features missing in bash (extended globbing, many
> >> variable and array operations etc.)
> >
> > AFAIK, this was not introduced by zsh but by ksh.
>
> Yes, you are right: To be historically correct, one should call

It migh be of interest that I recently asked David Korn whether adding a bunch 
of typical commands as builtins into the shell was introduced by ksh or by 
Bruce Perens (busybox). David answered:

As far as I know, I added these to ksh93 before busy box existed.

To be more verbose, even loadable builtins existed in ksh in the middle between 
ksh88 and ksh93.

> many of them "ksh features". However, fact is that zsh *has* almost
> all ksh features (with mainly identical syntax) while bash still
> lacks a lot of them (and for others it has a more cumbersome
> syntax).
>
> This might change in the long run: as mentioned, bash has

It also might be of interest that we decided to standardize a new way to manage 
builtin commands in the shell and this has been derived from the method that 
was introduced for OpenSolaris when ksh93 was added to OpenSolaris in August 
2007:

Builtins beyond the documented builtins from POSIX must be searched
by a tagged PATH in POSIX issue 8.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Martin Vaeth
Joerg Schilling  wrote:
>
> bash vs. POSIX, as bash tried to ignore long existing
> rules just because the bash maintainer did not understand them.

Are there really several? I know only one such example:
bash insists on compound commands ("{ ... }" or "( ... )")
for the function body while according to POSIX also
non-compound commmands can form the body, e.g.

hello() echo "hello world"

is a valid function definition according to POSIX
(and thus works in dash or also zsh) but not in bash:
Rumors say that the bash maintainer intentionally
excluded this due to some misinterpretation of the
POSIX formulation.




[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Martin Vaeth
Joerg Schilling  wrote:
> Martin Vaeth  wrote:
>>
>> This is not true, either: Although finally bash took some of the
>> features of zsh (arrays, regular expression matching, etc.) there
>> are still many features missing in bash (extended globbing, many
>> variable and array operations etc.)
>
> AFAIK, this was not introduced by zsh but by ksh.

Yes, you are right: To be historically correct, one should call
many of them "ksh features". However, fact is that zsh *has* almost
all ksh features (with mainly identical syntax) while bash still
lacks a lot of them (and for others it has a more cumbersome
syntax).

This might change in the long run: as mentioned, bash has
adopted a lot of ksh/zsh features over the years,
but a lot are still missing, and ksh/zsh has evolved meanwhile.

For instance, bash now finally has also a completion mechanism
which zsh had much longer before.
Moreover, my impression is that bash's mechanism is more in the
spirit to zsh's first attempt (zshcompctl) while since quite a
while zsh has "obsoleted" this mechanism and replaced by a much
superior/flexible one (zshcompsys).




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Joerg Schilling
Martin Vaeth  wrote:

> Neil Bothwick  wrote:
> >
> > In one sub-thread we've so far managed to cover:
> >
> > Bash vs Zsh
> > Vim vs Emacs
> > Perl vs Python
>
> not to forget: POSIX vs Bash

Let us better call it bash vs. POSIX, as bash tried to ignore long existing 
rules just because the bash maintainer did not understand them.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Peter Humphrey
On Monday 13 July 2015 11:21:22 Joerg Schilling wrote:
> Nikos Chantziaras  wrote:
> > On 10/07/15 02:34, Nikos Chantziaras wrote:
> > > I tried it [zsh], for exactly 10 seconds. My home/end keys didn't work.
> > > This gave me the impression of an unfinished project. Why on earth
> > > would anyone release a program after 1990 that doesn't know the
> > > home/end keys?> > 
> > > :-/
> > 
> > PS:
> > 
> > The "Del" key doesn't work either.
> 
> Well it seems to be strange but some people seem to believe that backspace
> is not to backspace in text but to delete chars.

Well I've been around a fair length of time and I don't remember it behaving 
any other way. Ever.

-- 
Rgds
Peter




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Joerg Schilling
Martin Vaeth  wrote:

> Neil Bothwick  wrote:
> > As a
> > scripting language, Bash is probably better
>
> This is not true, either: Although finally bash took some of the
> features of zsh (arrays, regular expression matching, etc.) there
> are still many features missing in bash (extended globbing, many
> variable and array operations etc.)

AFAIK, this was not introduced by zsh but by ksh.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-13 Thread Joerg Schilling
Nikos Chantziaras  wrote:

> On 10/07/15 02:34, Nikos Chantziaras wrote:
> > I tried it [zsh], for exactly 10 seconds. My home/end keys didn't work. This
> > gave me the impression of an unfinished project. Why on earth would
> > anyone release a program after 1990 that doesn't know the home/end keys?
> > :-/
>
> PS:
>
> The "Del" key doesn't work either.

Well it seems to be strange but some people seem to believe that backspace is 
not to backspace in text but to delete chars.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-12 Thread Martin Vaeth
Neil Bothwick  wrote:
>
> I agree. Being able to customise is good, but the defaults should be
> sensible and appealing to new users.

Yes, but not only new users but also not breaking expectations
of old users are important - it is a subtle balance,
and shells tend to be conservative here (bash is not
different in this respect concerning many features,
which are not enabled by default).

I encourage everybody with enough experience to make good
suggestions to write them on the zsh mailing list:
Usually, they are very responsive, especially if you have
good arguments.

(But, please, nobody should confuse "making suggestions"
with "trolling" which would be rather unproductive and
help nobody.)

To summarize my previous suggestion to unable most features
by default: They were rejected with the argument that for
almost any feature there are some users who feel disturbed
by it (a surprisingly large number of users "++" this
opinion...) and some use cases for which it is inappropriate.
For instance, in another part of this thread, we heard a
good reason, why things like the completion system can be
very irritating for some people/use cases.

That's why the result of that discussion was to improve
"only" the new-users module and to suggest default
configurations.
I did not complain about default key bindings, however,
since I consider other features more essential.




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-12 Thread Neil Bothwick
On Sun, 12 Jul 2015 19:52:34 +0300, Nikos Chantziaras wrote:

> > It is with shells as with editors: Whatever is the default,
> > quite a lot of people will not be satisfied with it.  
> 
> I disagree. It should work out of the box. People can change it later.
> 
> Having it not work at all is just stupid. The good way to write
> software is having it work and let people customize it if they want.
> Shipping it in a broken state is not good.

I agree. Being able to customise is good, but the defaults should be
sensible and appealing to new users. Zsh suffers from the same problem as
KDE, good software let down by poor defaults, although Gentoo's setup for
Zsh is better than upstream's.


-- 
Neil Bothwick

Do I BELIEVE in the Bible?! HELL man, I've SEEN one!!!


pgp543jm1MwhO.pgp
Description: OpenPGP digital signature


[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-12 Thread Nikos Chantziaras

On 11/07/15 23:56, Martin Vaeth wrote:

Nikos Chantziaras  wrote:


I really don't have time to learn arcane settings anymore.


That's why it is good that you can adapt the shell completely
to your needs: My opinion is that the computer must adapt to
*my* habits and not vice versa.


If it doesn't work out of the box


I don't see the relation with the above:
hobody recommended to use zsh without a reasonable configuration.
You have been told several ways to obtain a reasonable
configuration in a very quick way, and you are free to
change it to any special wishes.

It is with shells as with editors: Whatever is the default,
quite a lot of people will not be satisfied with it.


I disagree. It should work out of the box. People can change it later.

Having it not work at all is just stupid. The good way to write software 
is having it work and let people customize it if they want. Shipping it 
in a broken state is not good.






[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-11 Thread walt
On Fri, 10 Jul 2015 21:46:05 +1000
wraeth  wrote:

> Another thought that I just had was that, if this only occurs after
> running a command in the terminal and having that command output
> something to STDOUT/STDERR, it's possible that it's corrupting your
> terminal - the same as if you accidentally cat a binary file (which I
> just did).

I've noticed that the output of stty -a can differ slightly, so your
idea sounds probable. 

> 
> Given that you're likely not outputting binary to your terminal from
> running regular commands, have there been any changes to your fonts,
> LANG or other localization/output related components?

Definitely 'no' to my LANG/l10n settings, but fonts are a good candidate.
The output of 'qlop -l font' shows only media-libs/fontconfig was updated
anywhere near the relevant range of dates.









[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-11 Thread Martin Vaeth
Nikos Chantziaras  wrote:
>
> I really don't have time to learn arcane settings anymore.

That's why it is good that you can adapt the shell completely
to your needs: My opinion is that the computer must adapt to
*my* habits and not vice versa.

> If it doesn't work out of the box

I don't see the relation with the above:
hobody recommended to use zsh without a reasonable configuration.
You have been told several ways to obtain a reasonable
configuration in a very quick way, and you are free to
change it to any special wishes.

It is with shells as with editors: Whatever is the default,
quite a lot of people will not be satisfied with it.




[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-11 Thread Martin Vaeth
cov...@ccs.covici.com  wrote:
>
> I cannot see, so I use speakup or orca to read the screen

I have no experience whether zsh is appropriate for this.
Certainly zshrc-mv is not written with this case in mind,
and probably you should refrain from using
zsh-syntax-highlighting or auto-fu-zsh
(The duplication you observe might come from this:
Sometimes the whole line is rewritten to print the
words in appropriate color, and auto-fu-zsh
auto-completes during typing).

> Also, the comp systemis very confusing [...]
> it seems to be in columns of some sort

Yes: It is the choices, occasionally mixed with
explanations - one sees the difference usually by color.
If you press tab 3 times you can select from the choices
(the selection is inverted). Probably, if you have to listen
to which one is inverted (instead of seeing it), just typing
the name is probably more convenient.
So I completely agree that for a non-seeing person the whole
completion system is an anti-feature.




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-11 Thread covici
Martin Vaeth  wrote:

> Nikos Chantziaras  wrote:
> > On 10/07/15 18:00, Gevisz wrote:
> >> bindkey '^[[7~' beginning-of-line   # Home (xterm)
> >> bindkey '^[[8~'  end-of-line# End (xterm)
> >
> > lol... are these guys serious?
> >
> > It's 2015...
> 
> ... and yet the way of handling special keys in terminals has not
> changed: You cannot rely on any special sequence, since it depends
> on the terminal type (and changes also nowadays, depending on
> whether you use xterm, screen, tmux, linux console, ...).
> This is the reason why any fixed default can be wrong: What works in
> one terminal can break in another.
> The zsh way of doing this dynamically is much superior to the bash
> way of doing this statically in a fixed readline config file
> (which works only because *gentoo* provided a file which works
> for *most* linux terminals - I also had serious problems with bash
> and such keys when ssh-ing to e.g. sun stations; with zsh these
> problems are easily fixable).
> 
> One way to avoid the multiterm difficulty is to use the terminfo database
> of your current terminal. In zsh you do this as follows:
> 
> bindkey ${terminfo[khome]} beginning-of-line
> bindkey ${terminfo[kend]} end-of-line
> 
> (Yes, in zsh you usually do not have to quote variabeles!).
> 
> Note, however, that the above sets the keys only to your *current*
> terminal. If you call e.g. tmux later on and move your session to
> another terminal or you login from another terminal, you might again
> have problems, so it might be a good idea to set some sequences
> also for other terminals.
> 
> Again, I recommend you to use zshrc-mv from the mv overlay where
> all this (and much more) is done.
> 

hmmm, I am just trying zsh, and I still am having problems.  I cannot
see, so I use speakup or orca to read the screen to me and when I type
the second character of the command line, I hear the first character
again.  I am not sure what is happening, does the cursor move back a
character for a brief period, or what?  Also, the comp systemis very
confusing, its hard to read the list that is produced it seems to be in
columns of some sort and aside from just typing more characters on the
command line, I am not sure what to do.  I will look at your .zshrc, but
a lot of it will not do me any good, so I will read the docs and do
something.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-11 Thread Marc Joliet
Am Sat, 11 Jul 2015 13:22:56 +0300
schrieb Nikos Chantziaras :

> On 11/07/15 01:18, Marc Joliet wrote:
> > Am Fri, 10 Jul 2015 20:39:05 +0300
> > schrieb Nikos Chantziaras :
> >
> >> On 10/07/15 18:00, Gevisz wrote:
> >>> bindkey '^[[7~' beginning-of-line   # Home (xterm)
> >>> bindkey '^[[8~'  end-of-line# End (xterm)
> >>
> >> lol... are these guys serious?
> >>
> >> It's 2015...
> >
> > What's wrong with C-a and C-e?  On my keyboard they're not any more 
> > cumbersome
> > than reaching for Home/End (probably a bit less cumbersome in fact).
> 
> Pressing two keys at the same time with the same hand is not good. It 
> just feels awkward. I have special keys for that. They should be used.
> 
> Also, word-based navigation doesn't either. Ctrl+left or ctrl+right, for 
> example.
> 
> I guess the lack of good defaults kills this shell. I really don't have 
> time to learn arcane settings anymore. If it doesn't work out of the box 
> on what represents 99.% of machines, I'll have to pass and 
> wonder "what were they thinking?"

That's fair, it all comes down to personal preference, anyway.  It sounds to
me, though, that FISH (http://fishshell.com/) might be a good fit?  It goes
through a lot of trouble to work well out of the box, though it's different
enough in behaviour that it might take some getting used to (one reason I
don't use it as my root shell is that "VAR=override command" does not work,
you have to explicitly export the variable).  Anyway, it's just a suggestion.

-- 
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup


pgpYEGNMYbo2c.pgp
Description: Digitale Signatur von OpenPGP


[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-11 Thread Nikos Chantziaras

On 11/07/15 01:18, Marc Joliet wrote:

Am Fri, 10 Jul 2015 20:39:05 +0300
schrieb Nikos Chantziaras :


On 10/07/15 18:00, Gevisz wrote:

bindkey '^[[7~' beginning-of-line   # Home (xterm)
bindkey '^[[8~'  end-of-line# End (xterm)


lol... are these guys serious?

It's 2015...


What's wrong with C-a and C-e?  On my keyboard they're not any more cumbersome
than reaching for Home/End (probably a bit less cumbersome in fact).


Pressing two keys at the same time with the same hand is not good. It 
just feels awkward. I have special keys for that. They should be used.


Also, word-based navigation doesn't either. Ctrl+left or ctrl+right, for 
example.


I guess the lack of good defaults kills this shell. I really don't have 
time to learn arcane settings anymore. If it doesn't work out of the box 
on what represents 99.% of machines, I'll have to pass and 
wonder "what were they thinking?"





[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Martin Vaeth
Nikos Chantziaras  wrote:
> On 10/07/15 18:00, Gevisz wrote:
>> bindkey '^[[7~' beginning-of-line   # Home (xterm)
>> bindkey '^[[8~'  end-of-line# End (xterm)
>
> lol... are these guys serious?
>
> It's 2015...

... and yet the way of handling special keys in terminals has not
changed: You cannot rely on any special sequence, since it depends
on the terminal type (and changes also nowadays, depending on
whether you use xterm, screen, tmux, linux console, ...).
This is the reason why any fixed default can be wrong: What works in
one terminal can break in another.
The zsh way of doing this dynamically is much superior to the bash
way of doing this statically in a fixed readline config file
(which works only because *gentoo* provided a file which works
for *most* linux terminals - I also had serious problems with bash
and such keys when ssh-ing to e.g. sun stations; with zsh these
problems are easily fixable).

One way to avoid the multiterm difficulty is to use the terminfo database
of your current terminal. In zsh you do this as follows:

bindkey ${terminfo[khome]} beginning-of-line
bindkey ${terminfo[kend]} end-of-line

(Yes, in zsh you usually do not have to quote variabeles!).

Note, however, that the above sets the keys only to your *current*
terminal. If you call e.g. tmux later on and move your session to
another terminal or you login from another terminal, you might again
have problems, so it might be a good idea to set some sequences
also for other terminals.

Again, I recommend you to use zshrc-mv from the mv overlay where
all this (and much more) is done.




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Marc Joliet
Am Fri, 10 Jul 2015 20:39:05 +0300
schrieb Nikos Chantziaras :

> On 10/07/15 18:00, Gevisz wrote:
> > bindkey '^[[7~' beginning-of-line   # Home (xterm)
> > bindkey '^[[8~'  end-of-line# End (xterm)
> 
> lol... are these guys serious?
> 
> It's 2015...

What's wrong with C-a and C-e?  On my keyboard they're not any more cumbersome
than reaching for Home/End (probably a bit less cumbersome in fact).

(BTW: Home and End do work in FISH and BASH on my system, but not in ZSH.  FISH
I use for my normal user, and ZSH for root.  Oh, and /bin/sh links to
DASH :-) .  I sure have a lot of shells on my system...)

-- 
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup


pgpw0cL8upwPH.pgp
Description: Digitale Signatur von OpenPGP


[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Nikos Chantziaras

On 10/07/15 18:00, Gevisz wrote:

bindkey '^[[7~' beginning-of-line   # Home (xterm)
bindkey '^[[8~'  end-of-line# End (xterm)


lol... are these guys serious?

It's 2015...





[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Martin Vaeth
Neil Bothwick  wrote:
>
> In one sub-thread we've so far managed to cover:
>
> Bash vs Zsh
> Vim vs Emacs
> Perl vs Python

not to forget: POSIX vs Bash

> What are your thoughts on KDE, kernel modules or USE=3D"-*"? ;-)

Substitute "kernel modules" by Gnome (incl. systemd, policykit) and add
topics concerning pms and package managers, and I think that the list
of flamewar candidates concerning Gentoo Linux is complete.

So it is not unusual to have them in one thread, is it?

However, I did not hesitate to repeat the pro-Zsh arguments
(although I have probably posted them several times here)
because - as already mentioned in this thread - many people simply
are not even aware what they are missing due to lack of information.

Indeed, I would have saved a lot of time if I would have known the
advantages of zsh earlier, and I do not want that other suffer
from the same problem...

My experience was similar to the one mentioned in this thread:
With the default configuration zsh appeared disappointing at a
first glance, so I had ignored it for years, since bash was installed
and usually in the machine's memory anyway; only after many years and
knowing how much more productive I could have been with zsh,
I started to regret this decision.




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Gevisz
On Fri, 10 Jul 2015 09:16:01 +0100 Neil Bothwick  wrote:

> On Fri, 10 Jul 2015 02:36:50 +0300, Nikos Chantziaras wrote:
> 
> > > I tried it [zsh], for exactly 10 seconds. My home/end keys didn't
> > > work. This gave me the impression of an unfinished project. Why on
> > > earth would anyone release a program after 1990 that doesn't know the
> > > home/end keys? :-/  
> 
> I'd never even tried to use home/end in a shell, but you're right.
> 
> Going OT from this already OT sub-thread, I don't like using home/end, on
> destkop keyboards they are out of the way and on laptops they often
> require a double key press, so it's simple to use Ctrl-A/E to start with.
> 
> > The "Del" key doesn't work either.
> 
> It does here, but didn't on a Fedora install I recently did on a VPS. I
> copied my profile to the VPS and now Del works. I barely changed the
> default Gentoo config, but now you've mentioned home/end it will annoy
> me until I find a fix :(

bindkey '^[[7~' beginning-of-line   # Home (xterm)
bindkey '^[[8~'  end-of-line# End (xterm)

Source: http://www.strcat.de/dotfiles/dot.zshbindings

Just to save you a weekend. :)



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread wraeth
On Thu, Jul 09, 2015 at 03:37:12PM +0300, Nikos Chantziaras wrote:
> On 09/07/15 15:24, wraeth wrote:
> > On Thu, Jul 09, 2015 at 03:19:19PM +0300, Nikos Chantziaras wrote:
> >> On 09/07/15 14:48, Neil Bothwick wrote:
> >>> On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:
> >>>
>  As a wild guess into the blue, it could be related to readline. As I
>  see gentoo's bash uses the standalone readline from coreutils, while
>  the original bash source maintains an own trimmed version of readline..
>  just a thought

Another thought that I just had was that, if this only occurs after
running a command in the terminal and having that command output
something to STDOUT/STDERR, it's possible that it's corrupting your
terminal - the same as if you accidentally cat a binary file (which I
just did).

Given that you're likely not outputting binary to your terminal from
running regular commands, have there been any changes to your fonts,
LANG or other localization/output related components?

-- 
wraeth 
GnuPG Key: B2D9F759


signature.asc
Description: Digital signature


Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Neil Bothwick
On Fri, 10 Jul 2015 06:18:12 + (UTC), Martin Vaeth wrote:

> > As a
> > scripting language, Bash is probably better
> 
> This is not true, either: Although finally bash took some of the
> features of zsh (arrays, regular expression matching, etc.) there
> are still many features missing in bash (extended globbing, many
> variable and array operations etc.)

I must admit, I've not looked as scripting with Zsh for some years,
mainly for the reasons given below. If /bin/sh won't do, I probably
should be using shell at all.

> > although if I need that
> > much functionality in a script I would use Python instead of any shell
> > variant.
> 
> That's the mqin reason - together with the fact that bash is more
> widespread - why zsh is not used as much as it deserves:
> When you write a complex program you should probably use a
> high-level language to start with unless there are very good
> reasons why you can't (e.g. longer startup time etc.)
> (I would prefer perl over python as it appears to me to be similar
> with zsh vs. bash concerning features, although in the perl-python
> case it is not so clear since the languages have also some
> "philosophical" differences: For large projects it may be an
> *advantage* to have less language features, so that they are
> not misused by badly skilled team members...)

In one sub-thread we've so far managed to cover:

Bash vs Zsh
Vim vs Emacs
Perl vs Python

What are your thoughts on KDE, kernel modules or USE="-*"? ;-)


-- 
Neil Bothwick

deja vous - the act of forgetting someone's name /again/ despite being
introduced to them several times.


pgp80lgIeWFV5.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-10 Thread Neil Bothwick
On Fri, 10 Jul 2015 02:36:50 +0300, Nikos Chantziaras wrote:

> > I tried it [zsh], for exactly 10 seconds. My home/end keys didn't
> > work. This gave me the impression of an unfinished project. Why on
> > earth would anyone release a program after 1990 that doesn't know the
> > home/end keys? :-/  

I'd never even tried to use home/end in a shell, but you're right.

Going OT from this already OT sub-thread, I don't like using home/end, on
destkop keyboards they are out of the way and on laptops they often
require a double key press, so it's simple to use Ctrl-A/E to start with.

> The "Del" key doesn't work either.

It does here, but didn't on a Fedora install I recently did on a VPS. I
copied my profile to the VPS and now Del works. I barely changed the
default Gentoo config, but now you've mentioned home/end it will annoy
me until I find a fix :(


-- 
Neil Bothwick

Consciousness: that annoying time between naps.


pgp4Cc42HqnVL.pgp
Description: OpenPGP digital signature


[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Martin Vaeth
Neil Bothwick  wrote:
> As a
> scripting language, Bash is probably better

This is not true, either: Although finally bash took some of the
features of zsh (arrays, regular expression matching, etc.) there
are still many features missing in bash (extended globbing, many
variable and array operations etc.)

> although if I need that
> much functionality in a script I would use Python instead of any shell
> variant.

That's the mqin reason - together with the fact that bash is more
widespread - why zsh is not used as much as it deserves:
When you write a complex program you should probably use a
high-level language to start with unless there are very good
reasons why you can't (e.g. longer startup time etc.)
(I would prefer perl over python as it appears to me to be similar
with zsh vs. bash concerning features, although in the perl-python
case it is not so clear since the languages have also some
"philosophical" differences: For large projects it may be an
*advantage* to have less language features, so that they are
not misused by badly skilled team members...)





[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Martin Vaeth
Nikos Chantziaras  wrote:
>
> I tried it, for exactly 10 seconds. My home/end keys didn't work.

The default configuration is horrible, and they won't change it
since compatibility with stone age and all zsh features switched
off is a design goal of the defaults. I already wrote on their
list that they are scaring new users this way, but they don't care.

However, the new-users module should give you already quite useful
instructions, and once you are really familiar with the configuration
possibilities, you will see that it is *much* superior to bash.
(Of course, you can bind any keys, in contrast to bash even to
shell functions - there is a whole interface for it).

In fact, I do not know a single feature of bash which is not
available (and usually better) in zsh, while for the converse
there are hundreds of examples (especially if you use extensions
like zsh-syntax-highlighting or auto-fu-zsh which make use of
the possibilities mentioned above).
You might want to try zshrc-mv from the mv overlay which is
intended to be used with your favorite bashrc (i.e. it
intentionally sets only zsh-specific features and not
bashrc-features like "ordinary" aliases).




RE: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Franz Fellner
Nikos Chantziaras wrote:
> On 10/07/15 02:34, Nikos Chantziaras wrote:
> > I tried it [zsh], for exactly 10 seconds. My home/end keys didn't work. This
> > gave me the impression of an unfinished project. Why on earth would
> > anyone release a program after 1990 that doesn't know the home/end keys?
> > :-/
> 
> PS:
> 
> The "Del" key doesn't work either.

Have a look at the zshwiki [1] on how to bind keys. You might want to give the 
zkbd module a try.
For a good out-of-the-box-experience you can try one of the many zsh 
configuration frameworks. I used oh-my-zsh for quite a while until I found 
prezto [2], which started as a fork of oh-my-zsh but ended up as a complete 
rewrite. It feels and looks quite nice. Add "history-substring-search" and 
"syntax-highlighting" to the list of modules to load (~/.zpreztorc) to get an 
even nicer prompt.
With prezto I could completely skip key-bindings as it seems to manage all the 
cases itself pretty well.

[1] http://zshwiki.org/home/zle/bindkeys
[2] https://github.com/sorin-ionescu/prezto



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread wraeth
On Fri, Jul 10, 2015 at 02:36:50AM +0300, Nikos Chantziaras wrote:
> On 10/07/15 02:34, Nikos Chantziaras wrote:
> >I tried it [zsh], for exactly 10 seconds. My home/end keys didn't work. This
> >gave me the impression of an unfinished project. Why on earth would
> >anyone release a program after 1990 that doesn't know the home/end keys?
> >:-/
> 
> PS:
> 
> The "Del" key doesn't work either.
> 
> 

All of these are likely due to your input mode; and for the record the same
situation can exist in Bash as well (I've had customer servers that, when I hit
Home or Del, drops out of insert mode and changes three characters to uppercase
- it's frustrating!).

The 'vim' input mode is often difficult to understand at first, but the trick
with it is that, like vim, it has two states - insert mode and command mode,
whereby insert mode (oddly enough) inserts characters to the line, and command
mode allows for things like 'cw' to change a word or '~' to change the case of a
character.

That being said, it's all a matter of preference, and you should use whatever
feels most comfortable for you.
-- 
wraeth 
GnuPG Key: B2D9F759



[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Nikos Chantziaras

On 10/07/15 02:34, Nikos Chantziaras wrote:

I tried it [zsh], for exactly 10 seconds. My home/end keys didn't work. This
gave me the impression of an unfinished project. Why on earth would
anyone release a program after 1990 that doesn't know the home/end keys?
:-/


PS:

The "Del" key doesn't work either.




[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Nikos Chantziaras

On 09/07/15 19:07, Neil Bothwick wrote:

On Thu, 09 Jul 2015 15:07:40 +0300, Nikos Chantziaras wrote:

Don't ask such questions ;-)

This is in the same vein as the "emacs vs vim" argument.


True, people persist with Bash and vim, but in the latter case it
appears to be because they actually like it :-O

Most people use Bash because it is the default and they have never tried
anything else - just like the situation with most computer users and
Windows.

I'd been lectured on the wonders of zsh in the past, but it was only when
I had to learn to use it (I wrote a comparative review of shells) that I
realised what it offered over Bash as an interactive shell.


I tried it, for exactly 10 seconds. My home/end keys didn't work. This 
gave me the impression of an unfinished project. Why on earth would 
anyone release a program after 1990 that doesn't know the home/end keys? :-/





Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Neil Bothwick
On Thu, 9 Jul 2015 20:45:09 +0300, Gevisz wrote:

> I say "almost no old habits" because I actually have one:
> I used to Ctrl-R to search through the command history in bash
> and so far I have not figured what will be its equivalent in zsh,

Ctrl-R

> especially if to set its "input mode" to vim-like.

I've no idea what that is, but it sounds horrible.


-- 
Neil Bothwick

IRQs? We don't need no stinking IRQs!


pgpDIUtnxeDtA.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Gevisz
On Thu, 9 Jul 2015 17:07:43 +0100 Neil Bothwick  wrote:

> On Thu, 09 Jul 2015 15:07:40 +0300, Nikos Chantziaras wrote:
> 
> > >> I can't test it myself as a use a superior shell to
> > >> Bash  
> > >
> > > Which one? And why is it superior to bash?  
> > 
> > Don't ask such questions ;-)
> > 
> > This is in the same vein as the "emacs vs vim" argument.
> 
> True, people persist with Bash and vim, but in the latter case it
> appears to be because they actually like it :-O
> 
> Most people use Bash because it is the default and they have never tried
> anything else - just like the situation with most computer users and
> Windows.
> 
> I'd been lectured on the wonders of zsh in the past, but it was only when
> I had to learn to use it (I wrote a comparative review of shells) that I
> realised what it offered over Bash as an interactive shell. As a
> scripting language, Bash is probably better, although if I need that
> much functionality in a script I would use Python instead of any shell
> variant.
> 
> We now return you to your scheduled programming.

Because of your previous remark, I started to look at zsh.

I have never used any sophisticated features of bash,
so almost no old habits will stand on my way to zsh. :-)

Only the lack of time to read the documentation. :-)

I say "almost no old habits" because I actually have one:
I used to Ctrl-R to search through the command history in bash
and so far I have not figured what will be its equivalent in zsh,
especially if to set its "input mode" to vim-like.

But, probably, it is a question for zsh-use mailing list. :-)







Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Neil Bothwick
On Thu, 09 Jul 2015 15:07:40 +0300, Nikos Chantziaras wrote:

> >> I can't test it myself as a use a superior shell to
> >> Bash  
> >
> > Which one? And why is it superior to bash?  
> 
> Don't ask such questions ;-)
> 
> This is in the same vein as the "emacs vs vim" argument.

True, people persist with Bash and vim, but in the latter case it
appears to be because they actually like it :-O

Most people use Bash because it is the default and they have never tried
anything else - just like the situation with most computer users and
Windows.

I'd been lectured on the wonders of zsh in the past, but it was only when
I had to learn to use it (I wrote a comparative review of shells) that I
realised what it offered over Bash as an interactive shell. As a
scripting language, Bash is probably better, although if I need that
much functionality in a script I would use Python instead of any shell
variant.

We now return you to your scheduled programming.

 
-- 
Neil Bothwick

WinErr 01A: Operating system overwritten - Please reinstall all your
software. We are terribly sorry.


pgpDnCeVJN5Ob.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread wraeth
On Thu, Jul 09, 2015 at 03:37:12PM +0300, Nikos Chantziaras wrote:
> On 09/07/15 15:24, wraeth wrote:
> > On Thu, Jul 09, 2015 at 03:19:19PM +0300, Nikos Chantziaras wrote:
> >> On 09/07/15 14:48, Neil Bothwick wrote:
> >>> On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:
> >>>
>  As a wild guess into the blue, it could be related to readline. As I
>  see gentoo's bash uses the standalone readline from coreutils, while
>  the original bash source maintains an own trimmed version of readline..
>  just a thought
> >>>
> >>> In that case, re-emerging Bash with USE="-readline" should get rid of the
> >>> problem.
> >>
> >> Doesn't seem possible. That USE flag seems to get ignored by portage:
> >>  [...]
> >> echo "app-shells/bash -readline" >> /etc/portage/package.use
> >> emerge -uDN --with-bdeps=y @world
> >> [...]
> >> Nothing to merge; quitting.
> >>
> >> That USE flag doesn't do anything.
> >
> > Use the command `emerge -uav --changed-use app-shells/bash` - you need
> > to identify that it's a changed use flag, otherwise it ignores because
> > there are no new versions.
> 
> Still nothing. But I was using -N to begin with (--newuse) which is 
> stronger than --changed-use.
> 
> It doesn't seem possible to change that USE flag.
> 
> 

TL;DR:
Can't rebuld without readline because profile forces it on. You can
override this, but do so at your own risk (or at least, not at mine).

More info:

If you had included the line showing the package and use flags, I could
tell for certain, but I would guess that it's because the readline USE
flag is force-enabled in the base profile. This is indicated by brackets
'()' around the flag.

You can override this by creating the directory /etc/portage/profile and
adding the following text to the file 'package.use.force':

app-shells/bash:0 -readline

You should then be able to rebuild bash without the readline USE flag
enabled, however I'm not sure if that's an entirely wise thing to do -
it's force-enabled as part of the base profile (which leads me to thing
disabling is a bad idea), but the comment for it [1] notes:

# Force app-shells/bash[readline] in stage1 builds, so that compgen is
# available for sys-apps/portage (see bug #445576).

Bug #445576 [2] seems to indicate portage has a problem with bash's
readline implementation (at least >=bash-4.2), but I don't know if
that's still valid or not.

If only to see if this problem is bash's readline, you can disable the
force on the profile using the file above then quickly rebuild bash
using it's built-in with

USE="-readline" emerge -1aOv app-shells/bash

This way you don't have to worry about remembering to remove a
package.use (though you'd still have to remove the profile override).

Hope this helps.

[1] /usr/portage/profiles/base/package.use.force
[2] https://bugs.gentoo.org/show_bug.cgi?id=445576

-- 
wraeth 
GnuPG Key: B2D9F759


signature.asc
Description: Digital signature


[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread walt
On Thu, 9 Jul 2015 12:48:24 +0100
Neil Bothwick  wrote:

> On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:
> 
> > As a wild guess into the blue, it could be related to readline. As I
> > see gentoo's bash uses the standalone readline from coreutils, while
> > the original bash source maintains an own trimmed version of
> > readline.. just a thought
> 
> In that case, re-emerging Bash with USE="-readline" should get rid of
> the problem.
> 
> I can't test it myself as a use a superior shell to Bash

I just re-emerged bash with -readline and the ebuild ignored me,
apparently because I have the ncurses flag enabled.  I suppose I could
try disabling ncurses too, but I have no idea what to expect from that
so I'll wait and hope for wisdom to strike me like a bolt of lightening.





[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Nikos Chantziaras

On 09/07/15 15:24, wraeth wrote:

On Thu, Jul 09, 2015 at 03:19:19PM +0300, Nikos Chantziaras wrote:

On 09/07/15 14:48, Neil Bothwick wrote:

On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:


As a wild guess into the blue, it could be related to readline. As I
see gentoo's bash uses the standalone readline from coreutils, while
the original bash source maintains an own trimmed version of readline..
just a thought


In that case, re-emerging Bash with USE="-readline" should get rid of the
problem.


Doesn't seem possible. That USE flag seems to get ignored by portage:
 [...]
echo "app-shells/bash -readline" >> /etc/portage/package.use
emerge -uDN --with-bdeps=y @world
[...]
Nothing to merge; quitting.

That USE flag doesn't do anything.


Use the command `emerge -uav --changed-use app-shells/bash` - you need
to identify that it's a changed use flag, otherwise it ignores because
there are no new versions.


Still nothing. But I was using -N to begin with (--newuse) which is 
stronger than --changed-use.


It doesn't seem possible to change that USE flag.




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread wraeth
On Thu, Jul 09, 2015 at 03:19:19PM +0300, Nikos Chantziaras wrote:
> On 09/07/15 14:48, Neil Bothwick wrote:
> > On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:
> >
> >> As a wild guess into the blue, it could be related to readline. As I
> >> see gentoo's bash uses the standalone readline from coreutils, while
> >> the original bash source maintains an own trimmed version of readline..
> >> just a thought
> >
> > In that case, re-emerging Bash with USE="-readline" should get rid of the
> > problem.
> 
> Doesn't seem possible. That USE flag seems to get ignored by portage:
> 
>emerge --info bash
>[...]
>app-shells/bash-4.3_p39::gentoo was built with the following:
>USE="net (policykit) (readline) -afs -bashlogger -examples
>-mem-scramble -nls -plugins -vanilla" ABI_X86="64"
> 
> So "readline" is enabled. But:
> 
>echo "app-shells/bash -readline" >> /etc/portage/package.use
>emerge -uDN --with-bdeps=y @world
>[...]
>Nothing to merge; quitting.
> 
> That USE flag doesn't do anything.
> 
> 

Use the command `emerge -uav --changed-use app-shells/bash` - you need
to identify that it's a changed use flag, otherwise it ignores because
there are no new versions.

-- 
wraeth 
GnuPG Key: B2D9F759


signature.asc
Description: Digital signature


Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Gevisz
On Thu, 09 Jul 2015 15:07:40 +0300 Nikos Chantziaras  wrote:

> On 09/07/15 15:01, Gevisz wrote:
> > On Thu, 9 Jul 2015 12:48:24 +0100 Neil Bothwick  wrote:
> >
> >> On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:
> >>
> >>> As a wild guess into the blue, it could be related to readline. As I
> >>> see gentoo's bash uses the standalone readline from coreutils, while
> >>> the original bash source maintains an own trimmed version of readline..
> >>> just a thought
> >>
> >> In that case, re-emerging Bash with USE="-readline" should get rid of the
> >> problem.
> >>
> >> I can't test it myself as a use a superior shell to Bash
> >
> > Which one? And why is it superior to bash?
> 
> Don't ask such questions ;-)
> 
> This is in the same vein as the "emacs vs vim" argument.

I guess, it is zsh.

Already looking here: 
http://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692
 




[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Nikos Chantziaras

On 09/07/15 14:48, Neil Bothwick wrote:

On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:


As a wild guess into the blue, it could be related to readline. As I
see gentoo's bash uses the standalone readline from coreutils, while
the original bash source maintains an own trimmed version of readline..
just a thought


In that case, re-emerging Bash with USE="-readline" should get rid of the
problem.


Doesn't seem possible. That USE flag seems to get ignored by portage:

  emerge --info bash
  [...]
  app-shells/bash-4.3_p39::gentoo was built with the following:
  USE="net (policykit) (readline) -afs -bashlogger -examples
  -mem-scramble -nls -plugins -vanilla" ABI_X86="64"

So "readline" is enabled. But:

  echo "app-shells/bash -readline" >> /etc/portage/package.use
  emerge -uDN --with-bdeps=y @world
  [...]
  Nothing to merge; quitting.

That USE flag doesn't do anything.




[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-09 Thread Nikos Chantziaras

On 09/07/15 15:01, Gevisz wrote:

On Thu, 9 Jul 2015 12:48:24 +0100 Neil Bothwick  wrote:


On Thu, 09 Jul 2015 13:38:43 +0200, Stephan Müller wrote:


As a wild guess into the blue, it could be related to readline. As I
see gentoo's bash uses the standalone readline from coreutils, while
the original bash source maintains an own trimmed version of readline..
just a thought


In that case, re-emerging Bash with USE="-readline" should get rid of the
problem.

I can't test it myself as a use a superior shell to Bash


Which one? And why is it superior to bash?


Don't ask such questions ;-)

This is in the same vein as the "emacs vs vim" argument.





Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Florian Gamböck

Am 08.07.2015 um 15:10 schrieb Todd Goodman:

I haven't looked for that specifically in the ssh source code though.

And it sounds like it's happening to people even without interrupting
programs so it's unlikely the cause of all the problems.


I didn't say that SSH is the cause to that, I just said I can reproduce 
the issue with SSH. And since this didn't happen back in bash-4.2_p53, I 
doubt that SSH has to do something with it directly, but rather some 
change that happened between bash-4.2_p53 and bash-4.3_p33-r2.


--Flo



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Todd Goodman
* Florian Gamböck  [150708 03:15]:
> Am 08.07.2015 um 02:48 schrieb walt:
> > Next time this happens I'll include the output of stty -a. 
[..SNIP..]
> 
> After a small `diff`, the following changes have been made:
> lnext from ^V to ; icrnl, icanon, and echo from on to off (they 
> all got prefixed with a -).
> 
> Any ideas what can cause this behavior?
> 
> Regards,
> --Flo

A program can change terminal settings like this.  For example, when ssh
reads a password it can turn off echo so the password does not show up.

If you interrupt the program (^C) and it doesn't have a handler that
restores the original settings then this can happen.

I haven't looked for that specifically in the ssh source code though.

And it sounds like it's happening to people even without interrupting
programs so it's unlikely the cause of all the problems.

Todd



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Joerg Schilling
Florian Gamböck  wrote:

> I downloaded and compiled your archive.
>
> $ echo $0
> ./sh/OBJ/x86_64-linux-cc/sh
> $ $0 --version
> sh (Schily Bourne Shell) version 2015/06/27 a+ (x86_64-unknown-linux-gnu)
>
> Copyright (C) 1984-1989 AT&T
> Copyright (C) 1989-2009 Sun Microsystems
> Copyright (C) 1982-2015 Joerg Schilling
>
>
> Now I cannot reproduce the no-echo issue, at least with my ssh method. 
> But as I said, I also couldn't do it with `bash --posix`. So this seems 
> somehow related. The non-POSIX Bash seems to trigger something and 
> doesn't reset it under certain circumstances.

It seems that there is something related to my other mail:

 bash --posix
bash-4.1$ ls
MKLINKS   abbrev.h  bosh.mk1  defs.hfault.c   hashserv.c  mac.h
name.cpwd.csh_policy.h  sym.h  version.h
Makefile  alias.c   cmd.c dup.h func.cio.cmacro.c  
name.hservice.csignames.c   test.c word.c
Makefile.man  args.cctype.c   echo.cgmatch.c  jobs.c  main.c   
pfsh.1sh.1 stak.c   timeout.h  xec.c
OBJ   bltin.c   ctype.h   error.c   hash.cjsh.1   mode.h   
pfsh.mk1  sh.tour.ps   stak.h   ulimit.c
abbrev.c  bosh.1defs.cexpand.c  hash.hjsh.mk1 msg.c
print.c   sh_policy.c  string.c umask.c
bash-4.1$ stty -echo
bash-4.1$ MKLINKS   abbrev.hbosh.mk1  defs.hfault.c   
hashserv.c  mac.hname.cpwd.csh_policy.h  sym.h  version.h
Makefile  alias.c   cmd.c dup.h func.cio.cmacro.c  
name.hservice.csignames.c   test.c word.c
Makefile.man  args.cctype.c   echo.cgmatch.c  jobs.c  main.c   
pfsh.1sh.1 stak.c   timeout.h  xec.c
OBJ   bltin.c   ctype.h   error.c   hash.cjsh.1   mode.h   
pfsh.mk1  sh.tour.ps   stak.h   ulimit.c
abbrev.c  bosh.1defs.cexpand.c  hash.hjsh.mk1 msg.c
print.c   sh_policy.c  string.c umask.c
bash-4.1$ exit

Note that this is on Linux and I typed "ls" after "stty -echo"

Interesting: the final "exit" is printed...but this is done _after_ I typed the 
new-line.

It seems that there is something really strange inside the command line editing 
code in bash.

Note that The Bourne Shell does neither implement "emacs" nor "vi" mode but 
"ved" mode. Ved is an editor that is included as a reimplementation in the 
schily 
tools tarball. An editor with this interface and the same name first appeared 
on 
UNOS 1980. I don't know when the first ved version was written, it may be older 
than emacs.

So if you are using the Bourne Shell, you may observe minor differences to bash.
Note that an important difference is that my history editor remembers the 
cursor position in each command line. This makes it more convenient to change a 
single parameter in an existing command line.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Florian Gamböck

Hi Jörg,

Am 08.07.2015 um 12:13 schrieb Joerg Schilling:

Sorry for asking, but does Gentoo include the Bourne Shell?


$ readlink /bin/sh
bash

I guess this means "no" ...

If you like to do, the latest portable Bourne Shell is in: 
http://sourceforge.net/projects/schilytools/files/schily-2015-07-07.tar.bz2


I downloaded and compiled your archive.

$ echo $0
./sh/OBJ/x86_64-linux-cc/sh
$ $0 --version
sh (Schily Bourne Shell) version 2015/06/27 a+ (x86_64-unknown-linux-gnu)

Copyright (C) 1984-1989 AT&T
Copyright (C) 1989-2009 Sun Microsystems
Copyright (C) 1982-2015 Joerg Schilling


Now I cannot reproduce the no-echo issue, at least with my ssh method. 
But as I said, I also couldn't do it with `bash --posix`. So this seems 
somehow related. The non-POSIX Bash seems to trigger something and 
doesn't reset it under certain circumstances.


--Flo



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Joerg Schilling
Nikos Chantziaras  wrote:

> On 06/07/15 20:01, walt wrote:
> > This is the problem:  occasionally bash gets in a state where it stops
> > echoing the characters I type.  The commands I type continue to work
> > properly and I can see the output from them but I can't see the commands
> > on the screen as I type them.
>
> I remember having this problem. Especially when aborting programs with 
> CTRL+C.

I am interested to know how this can happen.

Note that AFAIK, UNIX would not allow a suitable tty mode that both allows to 
implement interactive editing inside a program _and_ letting the kernel do 
echoing for the editor at the same time.

This was possible in UNOS in 1980 (the first UNIX clone) and I used it for the 
first shell with comand line editor in 1982, but I could not use something 
similar on UNIX.

Now I did just run a test on Linux using bash and it turns out that calling 
"stty -echo" brings bash into a mode that does not print typed characters in 
the command line.

The shells that use my command line editor from 1982 (which is the first shell 
with command line editor "bsh" and since December 2006, my portable version of 
the Bourne Shell) always use a suitable tty mode for the command line editor - 
regardless what the user did set up using stty. It only restores the settings 
from the user when a user command is running.

Is bash explicitly implementing a history editor that does not echo characters 
in case that "stty -echo" was run? This would be a really bad idea.

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Nikos Chantziaras

On 06/07/15 20:01, walt wrote:

This is the problem:  occasionally bash gets in a state where it stops
echoing the characters I type.  The commands I type continue to work
properly and I can see the output from them but I can't see the commands
on the screen as I type them.


I remember having this problem. Especially when aborting programs with 
CTRL+C.


I don't seem to have it anymore though. Not sure when it stopped, but I 
suspect it's when I upgraded to bash-4.3_p39 from 4.3_p33-r2? (I'm on 
~amd64).





Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Joerg Schilling
Florian Gamböck  wrote:

> Hi Stephan,
>
> Am 08.07.2015 um 11:28 schrieb Stephan Müller:
> > As you can replicate it reliable, did you test it in Bourne shell? 
> > Maybe its not related to bash at all?
>
> $ echo $SHELL
> /bin/bash

Sorry for asking, but does Gentoo include the Bourne Shell?

If you like to do, the latest portable Bourne Shell is in:



http://sourceforge.net/projects/schilytools/files/schily-2015-07-07.tar.bz2

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ 
http://sourceforge.net/projects/schilytools/files/'



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Florian Gamböck

Hi Stephan,

Am 08.07.2015 um 11:28 schrieb Stephan Müller:
As you can replicate it reliable, did you test it in Bourne shell? 
Maybe its not related to bash at all?


$ echo $SHELL
/bin/bash

$ bash --version | head -n1
GNU bash, Version 4.3.33(1)-release (x86_64-pc-linux-gnu)

If I use /bin/sh (or to be accurate: /bin/bash --posix, since it is a 
symlink) then I do NOT run into the issue.


--Flo



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Stephan Müller

Am 08.07.2015 um 11:06 schrieb Florian Gamböck:


I can replicate it 100% when I ssh to another machine and immediately interrupt 
it with Ctrl-C.

I hadn't considered this a bug, but after reading this thread I can confirm 
that it also happens randomly with other commands. Not sure if there is always 
interruption involved, though ...

Perhaps some problem with forking / spawning a subshell and returning to the "status 
quo" after a non-zero exit code?

Regards,
--Flo



As you can replicate it reliable, did you test it in Bourne shell? Maybe its 
not related to bash at all?

 ~frukto



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Florian Gamböck

Am 08.07.2015 um 09:00 schrieb Alan McKinnon:

On 08/07/2015 07:00, Anton Shumskyi wrote:

Same for me, but it appears only after I'm canceling some job on
terminal with CTRL+C, maybe in 10% of total cases. I thought that was
some side-effect of switching env back, but because job is terminated in
a "bad way" haven't considered that as a bug.


Same here.

I always get this effect shortly after a Ctrl-key combination, not sure
which one but it's one of the grouping on the left of the keyboard
surrounding "S"


I can replicate it 100% when I ssh to another machine and immediately 
interrupt it with Ctrl-C.


I hadn't considered this a bug, but after reading this thread I can 
confirm that it also happens randomly with other commands. Not sure if 
there is always interruption involved, though ...


Perhaps some problem with forking / spawning a subshell and returning to 
the "status quo" after a non-zero exit code?


Regards,
--Flo



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Florian Gamböck

Am 08.07.2015 um 02:48 schrieb walt:
Next time this happens I'll include the output of stty -a. 


Since I just hit this bug I will do it for you if you don't mind. ;-)

I somehow managed to reproduce this issue by typing `ssh 
myothermachine`, hitting Enter, and immediately hitting Ctrl-C. 
Phenomenon is the same as described here.


`stty -a` before the incident:

speed 38400 baud; rows 26; columns 190; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 
= M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; 
werase = ^W; lnext = ^V; flush = ^O;

min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon 
-ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 
vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop 
-echoprt echoctl echoke


`stty -a` immediately after the incident, typed blindly into the terminal:

speed 38400 baud; rows 26; columns 190; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 
= M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; 
werase = ^W; lnext = ; flush = ^O;

min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon 
-ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 
vt0 ff0
isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop 
-echoprt echoctl echoke


After a small `diff`, the following changes have been made:
lnext from ^V to ; icrnl, icanon, and echo from on to off (they 
all got prefixed with a -).


Any ideas what can cause this behavior?

Regards,
--Flo



Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-08 Thread Alan McKinnon
On 08/07/2015 07:00, Anton Shumskyi wrote:
> Same for me, but it appears only after I'm canceling some job on
> terminal with CTRL+C, maybe in 10% of total cases. I thought that was
> some side-effect of switching env back, but because job is terminated in
> a "bad way" haven't considered that as a bug. 


Same here.

I always get this effect shortly after a Ctrl-key combination, not sure
which one but it's one of the grouping on the left of the keyboard
surrounding "S"

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-07 Thread Anton Shumskyi
Same for me, but it appears only after I'm canceling some job on terminal
with CTRL+C, maybe in 10% of total cases. I thought that was some
side-effect of switching env back, but because job is terminated in a "bad
way" haven't considered that as a bug.


Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-07 Thread Jc García
2015-07-06 8:09 GMT-06:00 Bill Kenworthy :
> On 07/07/15 04:43, Alex Thorne wrote:
>> I have also experienced this intermittently with bash. Running /reset
>> /returns the shell to normal for me. Echo is also set on for me, but
>> will check if this has changed next time I experience the issue.
>>
>> On 6 July 2015 at 20:07, »Q« mailto:boxc...@gmx.net>>
>> wrote:
>>
>> On Mon, 6 Jul 2015 20:18:18 +0300
>> Alexander Kapshuk > > wrote:
>>
>> > On Mon, Jul 6, 2015 at 8:01 PM, walt > > wrote:
>> > > My bash problem started a few weeks ago but I can't remember when.
>> > > This problem is intermittent and hard to reproduce.  I'm seeing it
>
> another "me too" - but rarely
>
An another me too also rarely, I thought it was related to my terminal
emulator, but I can't remember if it happened today.



[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-07 Thread walt
On Mon, 6 Jul 2015 20:18:18 +0300
Alexander Kapshuk  wrote:

> On Mon, Jul 6, 2015 at 8:01 PM, walt  wrote:
> > My bash problem started a few weeks ago but I can't remember when.
> > This problem is intermittent and hard to reproduce.  I'm seeing it
> > maybe less than ten times per day but often enough to be really
> > annoying.
> >
> > This is the problem:  occasionally bash gets in a state where it
> > stops echoing the characters I type.  The commands I type continue
> > to work properly and I can see the output from them but I can't see
> > the commands on the screen as I type them.
> >
> > So far I've seen this problem start *after* some bash command has
> > finished executing, e.g. after doing 'git diff'.  It never happens
> > when I open a new xterm, before I run a command.
> >
> > I emerged app-shells/sash and I don't see the problem there, so I
> > think this is a bash problem, but I'm just guessing.
> >
> > Any ideas?
> >
> >
> >
> 
> What's the output of 'stty -a'? Is the 'echo' attribute on, 'echo', or
> off, '-echo'?

Finally, after a very busy day of using bash with no problems, this
happened again and 'echo' was off (-echo).

The command triggering the problem was mpv, which I invoked from a
bash prompt to listen to an mp3 podcast file.

I noticed a warning message that mpv was linked against an earlier
version of ffmpeg than the one I have installed now (I'm on ~amd64 so
my rate of package turnover is quite high, naturally).  IIRC the
warning message was displayed in a different color from my normal black
font.  I think this may be true of other instances as well, not sure.

Anyone know of a mechanism that allows an app like mpv to set -echo?

BTW, I typed 'reset' which evidently restored 'echo' (now I can see the
characters I type) but the 'Backspace' key produces '^H' on the
terminal instead of deleting characters.

Next time this happens I'll include the output of stty -a.




Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-06 Thread Bill Kenworthy
On 07/07/15 04:43, Alex Thorne wrote:
> I have also experienced this intermittently with bash. Running /reset
> /returns the shell to normal for me. Echo is also set on for me, but
> will check if this has changed next time I experience the issue.
> 
> On 6 July 2015 at 20:07, »Q« mailto:boxc...@gmx.net>>
> wrote:
> 
> On Mon, 6 Jul 2015 20:18:18 +0300
> Alexander Kapshuk  > wrote:
> 
> > On Mon, Jul 6, 2015 at 8:01 PM, walt  > wrote:
> > > My bash problem started a few weeks ago but I can't remember when.
> > > This problem is intermittent and hard to reproduce.  I'm seeing it

another "me too" - but rarely

blindly running "stty sane" restores it

BillK





Re: [gentoo-user] Re: Anyone else having a problem with bash?

2015-07-06 Thread Alex Thorne
I have also experienced this intermittently with bash. Running *reset *returns
the shell to normal for me. Echo is also set on for me, but will check if
this has changed next time I experience the issue.

On 6 July 2015 at 20:07, »Q«  wrote:

> On Mon, 6 Jul 2015 20:18:18 +0300
> Alexander Kapshuk  wrote:
>
> > On Mon, Jul 6, 2015 at 8:01 PM, walt  wrote:
> > > My bash problem started a few weeks ago but I can't remember when.
> > > This problem is intermittent and hard to reproduce.  I'm seeing it
> > > maybe less than ten times per day but often enough to be really
> > > annoying.
> > >
> > > This is the problem:  occasionally bash gets in a state where it
> > > stops echoing the characters I type.  The commands I type continue
> > > to work properly and I can see the output from them but I can't see
> > > the commands on the screen as I type them.
> > >
> > > So far I've seen this problem start *after* some bash command has
> > > finished executing, e.g. after doing 'git diff'.  It never happens
> > > when I open a new xterm, before I run a command.
> > >
> > > I emerged app-shells/sash and I don't see the problem there, so I
> > > think this is a bash problem, but I'm just guessing.
> > >
> > > Any ideas?
> >
> > What's the output of 'stty -a'? Is the 'echo' attribute on, 'echo', or
> > off, '-echo'?
>
> I have the same symptoms as walt (except less often, probably because
> I'm typing in bash less often).  The echo attribute is on for me.
>
> I think (but am not certain) the problem started for me when I
> updated bash and readline following this stabilization:
> 
>
> In case it matters (and since I am using USE="-*"), here are my flags
> for those two packages.
>
> bash: nls readline -afs -bashlogger -examples -mem-scramble -net
>  -plugins -vanilla
>
> sys-libs/readline: -static-libs ABI_MIPS="-n32 -n64 -o32"
>  ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32"
>
>
>
>
>
>
>


[gentoo-user] Re: Anyone else having a problem with bash?

2015-07-06 Thread »Q«
On Mon, 6 Jul 2015 20:18:18 +0300
Alexander Kapshuk  wrote:

> On Mon, Jul 6, 2015 at 8:01 PM, walt  wrote:
> > My bash problem started a few weeks ago but I can't remember when.
> > This problem is intermittent and hard to reproduce.  I'm seeing it
> > maybe less than ten times per day but often enough to be really
> > annoying.
> >
> > This is the problem:  occasionally bash gets in a state where it
> > stops echoing the characters I type.  The commands I type continue
> > to work properly and I can see the output from them but I can't see
> > the commands on the screen as I type them.
> >
> > So far I've seen this problem start *after* some bash command has
> > finished executing, e.g. after doing 'git diff'.  It never happens
> > when I open a new xterm, before I run a command.
> >
> > I emerged app-shells/sash and I don't see the problem there, so I
> > think this is a bash problem, but I'm just guessing.
> >
> > Any ideas?
> 
> What's the output of 'stty -a'? Is the 'echo' attribute on, 'echo', or
> off, '-echo'?

I have the same symptoms as walt (except less often, probably because
I'm typing in bash less often).  The echo attribute is on for me.

I think (but am not certain) the problem started for me when I
updated bash and readline following this stabilization:


In case it matters (and since I am using USE="-*"), here are my flags
for those two packages.

bash: nls readline -afs -bashlogger -examples -mem-scramble -net
 -plugins -vanilla

sys-libs/readline: -static-libs ABI_MIPS="-n32 -n64 -o32" 
 ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32"