Bug 138000

Summary: when switching from an X console to a non-X console, something is interpreting the cursor visibility state of the switched-to console as applying to all other consoles if the visibility state of the switched-to console is hidden, but not if the state i...
Product: [Fedora] Fedora Reporter: Daniel Reed <djr>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: tomasz.szymanski, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-06 04:06:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Reed 2004-11-03 18:24:34 UTC
Version-Release number of selected component (if applicable):
kernel-2.6.9-1.649

How reproducible:
Every time

Steps to Reproduce:
Compile this C code as curs_set, -lncurses:
#include <ncurses.h>

int     main(int argc, char **args) {
        initscr();
        curs_set(atoi(args[1]));
        while (1)
                sleep(100);
        return(0);
}

Run ./curs_set 0 in tty4
Note that the cursor disappears.
Switch to X on tty7
Switch to tty5, note that the cursor is still blinking. Switch to tty4, note
that the cursor is correctly not blinking. Switch to tty5 again and not it is
still correctly blinking.
Switch to X on tty7
Switch directly to tty4. The cursor is correctly not blinking. Switch to tty5.
Note that the cursor is incorrectly also not blinking.

It appears that, when switching from an X console to a non-X console, something
is interpreting the cursor visibility state of the switched-to console as
applying to all other consoles if the visibility state of the switched-to
console is hidden, but not if the state is underscore (./curs_set 1) or block
(./curs_set 2).

Moving tty4 from curs_set 0 back to the default (by hitting ^C while curs_set is
running, flipping to another pty in screen on that terminal, etc.) is enough to
restore all other terminals' cursors (it "breaks the curse" so to speak).
Running ./curs_set 1 on any other terminal is also enough to break the curse
(without affecting tty4's hidden state).

Comment 1 Daniel Reed 2008-08-02 20:16:37 UTC
The original summary for this bug was longer than 255 characters, and so it was truncated when Bugzilla was upgraded. The original summary was:

when switching from an X console to a non-X console, something is interpreting the cursor visibility state of the switched-to console as applying to all other consoles if the visibility state of the switched-to console is hidden, but not if the state is underscore or block