mirror of
https://github.com/gunchev/home_bin.git
synced 2025-11-20 12:15:46 +00:00
Speed up fill generation, preserve $? for others.
This commit is contained in:
parent
54ccd1efb9
commit
9e91389b54
1 changed files with 4 additions and 2 deletions
|
|
@ -55,7 +55,7 @@ function prompt_command_exit() {
|
|||
}
|
||||
|
||||
function prompt_command() {
|
||||
# Save the error code
|
||||
# Save the error code, running any external command resets it!
|
||||
local E=$?
|
||||
|
||||
# Date, my format
|
||||
|
|
@ -87,7 +87,7 @@ function prompt_command() {
|
|||
let fillsize=${COLUMNS}-${#prompt}
|
||||
my_FILL=""
|
||||
if [ $fillsize -gt 0 ]; then
|
||||
my_FILL="─"
|
||||
my_FILL="────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||
while [ $fillsize -gt ${#my_FILL} ]; do
|
||||
my_FILL="${my_FILL}${my_FILL}${my_FILL}${my_FILL}"
|
||||
done
|
||||
|
|
@ -100,6 +100,8 @@ function prompt_command() {
|
|||
else
|
||||
my_PWD="${PWD}"
|
||||
fi
|
||||
# Let other PROMPT_COMMAND scripts (if any after us) have the error code too.
|
||||
bash -c "exit $E"
|
||||
}
|
||||
|
||||
function twtty {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue