Broken Termcaps
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-strong -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' -DNON_INTERACTIVE_LOGIN_SHELLS -Wno-parentheses -Wno-format-security uname output: Linux time-travel 4.4.48-1-MANJARO #1 SMP PREEMPT Thu Feb 9 22:17:50 UTC 2017 x86_64 GNU/Linux Machine Type: x86_64-unknown-linux-gnu Bash Version: 4.4 Patch Level: 12 Release Status: release Description: Bash rewrites on the same line if I exeed line terminal width lenght. Repeat-By: I write a long line on the terminal and when I exceed the terminal width lenght it does not go on the next line, but rewrites on the same. If I continue the line again till the end of terminal width, it will now go on the next line. So I think it is a termcaps misconfiguration (?). For example if the real terminal width is 100, bash thinks he has 200, so it waits the 200th char to go on the next line. I hope I was explicit enough. I can send a screenshot of the issue. Sent with [ProtonMail](https://protonmail.com) Secure Email.
Re: Broken Termcaps
There: >echo $TERM xterm-256color > echo $PS1 \[\033[01;32m\][\u@\h\[\033[01;37m\] \W$(__git_ps1 " (\033[31m%s\033[37m)")\033[32m]\$\[\033[00m\] >uname -a Linux time-travel 4.4.48-1-MANJARO #1 SMP PREEMPT Thu Feb 9 22:17:50 UTC 2017 x86_64 GNU/Linux >infocmp # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color xterm-256color|xterm with 256 colors, am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, colors#256, cols#80, it#8, lines#24, pairs#32767, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H, ... I am currently writing a shell in C, it works nicely with multi lines so I don't think it's a missing termcap or something to do with it... Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 10:52 PM UTC Time: March 1, 2017 9:52 PM From: wool...@eeg.ccf.org To: Eduardo Bustamante Lfabbro , bug-bash@gnu.org On Wed, Mar 01, 2017 at 09:48:08PM +, Eduardo Bustamante wrote: > El mié., mar. 1, 2017 3:46 PM, Eduardo Bustamante > escribió: > > Description: > > Bash rewrites on the same line if I exeed line terminal width lenght. > > > Do you have an exotic PS1 or PROMPT_COMMAND ? That was one of my initial thoughts too, but he seemed to talk about ksh style side-scrolling when writing a long command, so my second thought was that his TERM variable is wrong, or his system doesn't have a terminal definition for whatever TERM variable he is using. But then he seemed to imply that the side-scrolling stopped happening after a while, at which point I gave up trying to understand. Original poster: please tell us what terminal you are using, and what the value of "$TERM" is. Also which operating system you're on, and if you're ambitious, the output of "infocmp" on this system. Or at least the first few lines of it, just to verify that it actually exists and does not give an error. I'm hoping that you didn't mean termcap literally, because termcap is legacy BSD stuff from 3 decades ago that nobody should be using today.
Re: Broken Termcaps
Oh! And thanks for your fast reply! Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 11:02 PM UTC Time: March 1, 2017 10:02 PM From: lfabbr...@protonmail.com To: Greg Wooledge Eduardo Bustamante , bug-bash@gnu.org There: >echo $TERM xterm-256color > echo $PS1 \[\033[01;32m\][\u@\h\[\033[01;37m\] \W$(__git_ps1 " (\033[31m%s\033[37m)")\033[32m]\$\[\033[00m\] >uname -a Linux time-travel 4.4.48-1-MANJARO #1 SMP PREEMPT Thu Feb 9 22:17:50 UTC 2017 x86_64 GNU/Linux >infocmp # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color xterm-256color|xterm with 256 colors, am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, colors#256, cols#80, it#8, lines#24, pairs#32767, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H, ... I am currently writing a shell in C, it works nicely with multi lines so I don't think it's a missing termcap or something to do with it... Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 10:52 PM UTC Time: March 1, 2017 9:52 PM From: wool...@eeg.ccf.org To: Eduardo Bustamante Lfabbro , bug-bash@gnu.org On Wed, Mar 01, 2017 at 09:48:08PM +, Eduardo Bustamante wrote: > El mié., mar. 1, 2017 3:46 PM, Eduardo Bustamante > escribió: > > Description: > > Bash rewrites on the same line if I exeed line terminal width lenght. > > > Do you have an exotic PS1 or PROMPT_COMMAND ? That was one of my initial thoughts too, but he seemed to talk about ksh style side-scrolling when writing a long command, so my second thought was that his TERM variable is wrong, or his system doesn't have a terminal definition for whatever TERM variable he is using. But then he seemed to imply that the side-scrolling stopped happening after a while, at which point I gave up trying to understand. Original poster: please tell us what terminal you are using, and what the value of "$TERM" is. Also which operating system you're on, and if you're ambitious, the output of "infocmp" on this system. Or at least the first few lines of it, just to verify that it actually exists and does not give an error. I'm hoping that you didn't mean termcap literally, because termcap is legacy BSD stuff from 3 decades ago that nobody should be using today.
Re: Broken Termcaps
Greg, I'm not sure what you mean by termcaps are legacy... I mean, I personally use curses.h, term.h and termios.h aren't them termcaps? Why are them legacy and should not be used? We must use them for our shell project... The prompt actually use escapes for colors and to print branch name if I am on a git folder. I suppose the bug comes from that. I try to modify my prompt, using protection as you mentioned. And do you have a simple one I can use to test? Thanks again. Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 11:03 PM UTC Time: March 1, 2017 10:03 PM From: lfabbr...@protonmail.com To: Greg Wooledge Eduardo Bustamante , bug-bash@gnu.org Oh! And thanks for your fast reply! Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 11:02 PM UTC Time: March 1, 2017 10:02 PM From: lfabbr...@protonmail.com To: Greg Wooledge Eduardo Bustamante , bug-bash@gnu.org There: >echo $TERM xterm-256color > echo $PS1 \[\033[01;32m\][\u@\h\[\033[01;37m\] \W$(__git_ps1 " (\033[31m%s\033[37m)")\033[32m]\$\[\033[00m\] >uname -a Linux time-travel 4.4.48-1-MANJARO #1 SMP PREEMPT Thu Feb 9 22:17:50 UTC 2017 x86_64 GNU/Linux >infocmp # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color xterm-256color|xterm with 256 colors, am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, colors#256, cols#80, it#8, lines#24, pairs#32767, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H, ... I am currently writing a shell in C, it works nicely with multi lines so I don't think it's a missing termcap or something to do with it... Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 10:52 PM UTC Time: March 1, 2017 9:52 PM From: wool...@eeg.ccf.org To: Eduardo Bustamante Lfabbro , bug-bash@gnu.org On Wed, Mar 01, 2017 at 09:48:08PM +, Eduardo Bustamante wrote: > El mié., mar. 1, 2017 3:46 PM, Eduardo Bustamante > escribió: > > Description: > > Bash rewrites on the same line if I exeed line terminal width lenght. > > > Do you have an exotic PS1 or PROMPT_COMMAND ? That was one of my initial thoughts too, but he seemed to talk about ksh style side-scrolling when writing a long command, so my second thought was that his TERM variable is wrong, or his system doesn't have a terminal definition for whatever TERM variable he is using. But then he seemed to imply that the side-scrolling stopped happening after a while, at which point I gave up trying to understand. Original poster: please tell us what terminal you are using, and what the value of "$TERM" is. Also which operating system you're on, and if you're ambitious, the output of "infocmp" on this system. Or at least the first few lines of it, just to verify that it actually exists and does not give an error. I'm hoping that you didn't mean termcap literally, because termcap is legacy BSD stuff from 3 decades ago that nobody should be using today.
Re: Broken Termcaps
Yes you were right the error comes from PS1... I'm sad I have no more the git branch on the prompt... :( Now I use: ps1="\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\]" Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 11:15 PM UTC Time: March 1, 2017 10:15 PM From: lfabbr...@protonmail.com To: Greg Wooledge Eduardo Bustamante , bug-bash@gnu.org Greg, I'm not sure what you mean by termcaps are legacy... I mean, I personally use curses.h, term.h and termios.h aren't them termcaps? Why are them legacy and should not be used? We must use them for our shell project... The prompt actually use escapes for colors and to print branch name if I am on a git folder. I suppose the bug comes from that. I try to modify my prompt, using protection as you mentioned. And do you have a simple one I can use to test? Thanks again. Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 11:03 PM UTC Time: March 1, 2017 10:03 PM From: lfabbr...@protonmail.com To: Greg Wooledge Eduardo Bustamante , bug-bash@gnu.org Oh! And thanks for your fast reply! Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 11:02 PM UTC Time: March 1, 2017 10:02 PM From: lfabbr...@protonmail.com To: Greg Wooledge Eduardo Bustamante , bug-bash@gnu.org There: >echo $TERM xterm-256color > echo $PS1 \[\033[01;32m\][\u@\h\[\033[01;37m\] \W$(__git_ps1 " (\033[31m%s\033[37m)")\033[32m]\$\[\033[00m\] >uname -a Linux time-travel 4.4.48-1-MANJARO #1 SMP PREEMPT Thu Feb 9 22:17:50 UTC 2017 x86_64 GNU/Linux >infocmp # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color xterm-256color|xterm with 256 colors, am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, colors#256, cols#80, it#8, lines#24, pairs#32767, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H, ... I am currently writing a shell in C, it works nicely with multi lines so I don't think it's a missing termcap or something to do with it... Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message Subject: Re: Broken Termcaps Local Time: March 1, 2017 10:52 PM UTC Time: March 1, 2017 9:52 PM From: wool...@eeg.ccf.org To: Eduardo Bustamante Lfabbro , bug-bash@gnu.org On Wed, Mar 01, 2017 at 09:48:08PM +, Eduardo Bustamante wrote: > El mié., mar. 1, 2017 3:46 PM, Eduardo Bustamante > escribió: > > Description: > > Bash rewrites on the same line if I exeed line terminal width lenght. > > > Do you have an exotic PS1 or PROMPT_COMMAND ? That was one of my initial thoughts too, but he seemed to talk about ksh style side-scrolling when writing a long command, so my second thought was that his TERM variable is wrong, or his system doesn't have a terminal definition for whatever TERM variable he is using. But then he seemed to imply that the side-scrolling stopped happening after a while, at which point I gave up trying to understand. Original poster: please tell us what terminal you are using, and what the value of "$TERM" is. Also which operating system you're on, and if you're ambitious, the output of "infocmp" on this system. Or at least the first few lines of it, just to verify that it actually exists and does not give an error. I'm hoping that you didn't mean termcap literally, because termcap is legacy BSD stuff from 3 decades ago that nobody should be using today.