Bug 113195 - First line displayed incorrectly if prompt changes background color
First line displayed incorrectly if prompt changes background color
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: vte (Show other bugs)
5
All Linux
low Severity low
: ---
: ---
Assigned To: Behdad Esfahbod
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-09 11:28 EST by Kasper Dupont
Modified: 2008-03-10 00:54 EDT (History)
0 users

See Also:
Fixed In Version: Fedora 8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-10 00:54:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshot of incorrectly displayed gnome-terminal (10.93 KB, image/png)
2004-01-09 11:29 EST, Kasper Dupont
no flags Details

  None (edit)
Description Kasper Dupont 2004-01-09 11:28:33 EST
Description of problem:
If the PS1 prompt environment variable changes the background color
the entire first line is displayed with that color eventhough only the
prompt should have a different background color. Initially the problem
is only visible in the first two chars right of the cursor, but if
parts of the window is redrawn for example after being hidden behind
another window, the entire first line is shown with wrong background
color. If a reset sequence ESC c is sent to the terminal, the problem
disapears, only the first line after the window has been opened is
affected.

Version-Release number of selected component (if applicable):
2.4.0.1-1

How reproducible:
Happens always

Steps to Reproduce:
1. PS1='\[\015\033[46m\][\u@\h:\w]\[\033[0m\] gnome-terminal
  
Actual results:
The prompt and some chars right of the cursor is displayed with
different background color.

Expected results:
Only the prompt is displayed with different background color, the rest
of the first line is displayed with white background color.
Comment 1 Kasper Dupont 2004-01-09 11:29:42 EST
Created attachment 96860 [details]
Screenshot of incorrectly displayed gnome-terminal
Comment 2 Ray Strode [halfline] 2005-05-11 18:14:54 EDT
Fedora Core 1 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.
Comment 3 Kasper Dupont 2005-05-12 02:53:46 EDT
This bug also exist in FC3. And just in case it isn't obvious, there is a minor
typo in the command to reproduce the symptom, a ' character is missing. Using
this command will reproduce the problem:

PS1='\[\033[46m\][\u@\h:\w]\[\033[0m\] ' gnome-terminal
Comment 4 Ray Strode [halfline] 2005-05-12 10:36:25 EDT
Hmm, interesting.  

Slightly more robust reproduction instructions:

PS1='\[\033[46m\][\u@\h:\w]\[\033[0m\] ' gnome-terminal --disable-factory -e
"/bin/sh"

This is likely a vte bug (vte is the rendering widget used by gnome-terminal).

I'm going to reassign it to the vte component.
Comment 5 Matthew Miller 2006-07-10 15:43:15 EDT
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.
Comment 6 Kasper Dupont 2006-07-10 15:57:05 EDT
This problem also exist in FC4. I don't yet have any FC5 installation to test it
there.
Comment 7 Behdad Esfahbod 2006-07-10 17:28:34 EDT
Happens in FC5 still.  Not sure if it's vte or bash.
Comment 8 Kasper Dupont 2006-07-10 17:36:18 EDT
I don't see how this could be a bash bug. It works fine with xterm. And I
believe bash does output the correct character sequence. I think the possible
places to search for this bug is in gnome-terminal and the libraries it uses.

It could theoretically be an X server bug. But since I'm able to reproduce this
with an entirely different X server as well, I don't think that is a likely
explanation.
Comment 9 Behdad Esfahbod 2006-07-10 18:49:28 EDT
How do you do the same with xterm?  My xterm doesn't seem to pass PS1 to the
bash inside.
Comment 10 Kasper Dupont 2006-07-11 03:11:15 EDT
xterm certainly should pass the full environment to the shell inside. But maybe
the shell inside will reset the PS1 environment variable, this depends on
configuration files. The following two commands should tell you what environment
is passed (I'll try to come up with a better way to reproduce the problem).

PS1='\[\033[46m\][\u@\h:\w]\[\033[0m\] ' strace -v -f -e execve xterm -e /bin/sh
PS1='\[\033[46m\][\u@\h:\w]\[\033[0m\] ' strace -v -f -e execve gnome-terminal
-e /bin/sh
Comment 11 Kasper Dupont 2006-07-11 03:16:02 EDT
Does this show the difference in your case?
printf '\033[46m[\u@\h:\w]\033[0m ' >/tmp/PS1
gnome-terminal -e 'cat /tmp/PS1 /dev/tty'
xterm -e 'cat /tmp/PS1 /dev/tty'
Comment 12 Behdad Esfahbod 2006-07-14 12:02:25 EDT
(In reply to comment #11)
> Does this show the difference in your case?
> printf '\033[46m[\u@\h:\w]\033[0m ' >/tmp/PS1
> gnome-terminal -e 'cat /tmp/PS1 /dev/tty'
> xterm -e 'cat /tmp/PS1 /dev/tty'

Yep, that does the trick.
Comment 13 petrosyan 2008-02-15 17:44:51 EST
Fedora Core 5 is not maintained anymore.

Can you reproduce this bug in Fedora 8?
Comment 14 Kasper Dupont 2008-02-15 20:37:56 EST
I haven't been able to reproduce it in Fedora 8. (Have only tried two times).

Note You need to log in before you can comment on or make changes to this bug.