bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:


From: Valentin Bajrami
Subject: Re:
Date: Wed, 12 Dec 2018 21:04:02 +0100

Alright, so it seems PS1 is causing the problem.  I removed the line from
~/.bashrc file and the shell is behaving normal again. Thanks for pointing
that out and apologies for the noise.

Kind regards,
Valentin

On Wed, Dec 12, 2018 at 8:56 PM Valentin Bajrami <address@hidden>
wrote:

> Hi guys and thanks for the quick reply.  I think Greg had a good point
> there mentioning my PS1. I have it slightly modified for my personal needs
> but this is happening even though I run bash with --norc flag
>
> A piece of my ~/.bashrc file is as follows:
>
> color_enabled() {
>     local -i colors=$(tput colors 2>/dev/null)
>     [[ $? -eq 0 ]] && [[ $colors -gt 2 ]]
> }
>
> BOLD_FORMAT="${BOLD_FORMAT-$(color_enabled && tput bold)}"
> ERROR_FORMAT="${ERROR_FORMAT-$(color_enabled && tput setaf 1)}"
> WARNING_FORMAT="${WARNING_FORMAT-$(color_enabled && tput setaf 3)}"
> INFO_FORMAT="${INFO_FORMAT-$(color_enabled && tput setaf 4)}"
> RESET_FORMAT="${RESET_FORMAT-$(color_enabled && tput sgr0)}"
>
> # Exit code
> export PS1='$(exit_code=$?; [[ $exit_code -eq 0 ]] && printf %s
> \[$BOLD_FORMAT\]\[$INFO_FORMAT\]\h:\w \[$RESET_FORMAT\]$ " " || printf %s
> \[$BOLD_FORMAT\]\[$ERROR_FORMAT\]\h:\w[$exit_code]\[$RESET_FORMAT\]$ " ")'
>
>
>
> On Wed, Dec 12, 2018 at 5:49 PM Chet Ramey <address@hidden> wrote:
>
>> On 12/12/18 11:36 AM, Valentin Bajrami wrote:
>> > While playing around a bit with dotglob and nullglob the following
>> testcase
>> > seem to fail when cd'ing to a non existing directory. The shell seems to
>> > hang there and sending a SIGINT isn't having much effect.
>> >
>> > f3d0r4:~$ pwd
>> > /home/valentin.local
>> > f3d0r4:~$ shopt -s nullglob dotglob
>> > f3d0r4:~$ f=(*)
>> > f3d0r4:~$ (( ${#f[*]} )) || printf '%s\n' "This dir is empty"
>> > f3d0r4:~$ echo "$BASH_VERSION"
>> > 4.4.23(1)-release
>> > f3d0r4:~$ cd ../Nonexistingdir
>> > bash: cd: ../Nonexistingdir: No such file or directory
>> >  ^C
>> >  ^C
>> >  cd Desktop/
>> > f3d0r4:~/Desktop$
>>
>> I can't reproduce it. I suppose something similar could happen if /home
>> is on an NFS-mounted file system.
>>
>> --
>> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>>                  ``Ars longa, vita brevis'' - Hippocrates
>> Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/
>>
>
>
> --
> Met vriendelijke groet,
>
> Valentin Bajrami
>


-- 
Met vriendelijke groet,

Valentin Bajrami


reply via email to

[Prev in Thread] Current Thread [Next in Thread]