You are not logged in.
Pages: 1
Hello, everybody! First time arch user here. I'm currently using bash 5.0.17. Whenever I cd into some directory it prints my PS1 like this:
[zhurik@godzilla ~]$ cd Projects/
[zhurik@godzilla ~]$ [zhurik@godzilla Projects]$
However I expect it to print something like this:
[zhurik@godzilla ~]$ cd Projects/
[zhurik@godzilla Projects]$
Or whenever I run some program I expect it to print it output and then print prompt.
How it is now:
[zhurik@godzilla test-1]$ python main.py
[zhurik@godzilla test-1]$ {"ts":123456,"updates":[]}Finish
[zhurik@godzilla test-1]$
It's super inconvenient, because it prints prompt right away, like program has finished.
How it should be:
[zhurik@godzilla test-1]$ python main.py
{"ts":123456,"updates":[]}Finish
[zhurik@godzilla test-1]$
And prompt should appear only after program has finished.
I don't think that it's the problem of my terminal (konsole), because in other tty's it's the same.
Sorry if duplicate, but I can't find it for the life of me.
Last edited by zhurik (2020-08-07 08:30:23)
Offline
Paste your .bashrc...
Offline
Just copy /etc/bash.bashrc to ~/.bashrc:
cp /etc/bash.bashrc ~/.bashrc and source it:
source ~/.bashrcthis should fix some mess around the PS1 variable.
Offline
Paste your .bashrc...
My .bashrc:
# ~/.bashrc
## If not running interactively, don't do anything
[[ $- != *i* ]] && returnif [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
Last edited by zhurik (2020-08-07 07:55:05)
Offline
Just copy /etc/bash.bashrc to ~/.bashrc:
cp /etc/bash.bashrc ~/.bashrcand source it:
source ~/.bashrcthis should fix some mess around the PS1 variable.
It didn't help
Offline
pacman -Qkk bashOffline
pacman -Qkk bash
[zhurik@godzilla ~]$ [zhurik@godzilla ~]$ pacman -Qkk bash
[zhurik@godzilla ~]$ bash: 241 total files, 0 altered files
Offline
Post your ~/.bash_aliases, /etc/bash.bashrc and the output of
$ shopt checkwinsizeLast edited by schard (2020-08-07 08:24:34)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Post your ~/.bash_aliases, /etc/bash.bashrc and the output of
$ shopt checkwinsize
My .bash_aliases:
# Включаем цвета у разных команд
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi# Разные варианты ls
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias ld='ls -d */ 2> /dev/null'# Чистим экран как в винде
alias cls='clear'# Nuff said
alias starwars='telnet towel.blinkenlights.nl'# Был какой-то, оставлю что ли
PS0='[\u@\h \W]\$ '
I commented last line (actually, I will delete it) and everything works as I want. Thanks!
P.S. Can somebody explaint what PS0 variable is?
Offline
And there we have your $PS0 as the culprit.
Bash expands and displays PS0 after it reads a command but before executing it. See Controlling the Prompt, for a complete list of prompt string escape sequences.
Last edited by schard (2020-08-07 08:33:55)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Seems like you misspelled PS1 there. ![]()
(Although it is the default anyway.)
Your .bash_aliases file really should restrict itself to declaring aliases, not variables. Otherwise the code organization split is nonsensical.
Just copy /etc/bash.bashrc to ~/.bashrc:
cp /etc/bash.bashrc ~/.bashrcand source it:
source ~/.bashrcthis should fix some mess around the PS1 variable.
This makes absolutely zero sense, /etc/bash.bashrc is loaded already -- before ~/.bashrc is. If the error comes from elsewhere this won't help, and if it does come from there, deleting the file accomplishes the same goal.
The default ~/.bashrc for new profiles is copied from /etc/skel/.bashrc
Last edited by eschwartz (2020-08-07 13:39:48)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Pages: 1