[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Including \t, \T or \A at beginning of PS1 causes line wrap issues
From: |
drankin |
Subject: |
Including \t, \T or \A at beginning of PS1 causes line wrap issues |
Date: |
Tue, 14 Jan 2014 23:14:56 -0600 (CST) |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_FORTIFY_SOURCE=2
-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin'
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout'
uname output: Linux phoinix 3.12.6-1-ARCH #1 SMP PREEMPT Fri Dec 20 19:39:00
CET 2013 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu
Bash Version: 4.2
Patch Level: 45
Release Status: release
Description:
Including the current time in the prompt causes line wrap issues on the
command line. This is apparently a regression because for at least 4 out of 5
of the past years this problem was not present. Specifically if long command
lines wrap, then it is impossible to edit the command line by using up-arrow to
put the old command on the command line due to this wrap issue. Here is an
example:
The command line at issue was:
diff -uNr ../hal/src/hal-0.5.14/policy/Makefile.am hal-0.5.14/policy/Makefile.am
export PS1="\A \h:\w> "
Then attempting to recall and edit the command with up-arrow, result in
variations of the following:
22:15 phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> diff -uNr
../hal/src/hal-0.5.14/policy/Makefile.am hal-0.5.14/pol/Makefile.am
Now attempting with \t:
22:39:05 phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> export PS1="\t \h:\w> "
22:39:28 phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> diff -uNr
../hal/src/hal-0.5.14/policy/Makefile.am hal-0.5.14/icy/Makefile.am
phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> diff -uNr
../hal/src/hal-0.5.14/policy/Makefile.am hal-0.5.14/policy/Maile.am
phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> diff -uNr
../hal/src/hal-0.5.14/policy/Makefile.am hal5.14/policy/Makefile.am
Now eliminating the \t and the prompt returns to normal:
22:45:47 phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> export PS1="\h:\w> "
phoinix:/dat_e/tde/tstbld/srcnew/bld/halo> diff -uNr
../hal/src/hal-0.5.14/policy/Makefile.am hal-0.5.14/policy/Maile.am
Repeat-By:
Include either \t or \T or \A (my preferred prompt) at the beginning of
the PS1 prompt designation and execute a command line that wraps and you will
experience missing character when attempting to re-edit the command.
Fix:
Haven't a clue, but I know it was fixed before sometime around
2008/2009 and now it is back. Bummer. Let me know if you need any additional
information. Thank you.