All the control commands don't work. ^C, ^Z while waiting for an input (but work on ubuntu 20.04)

Bug #2015062 reported by Contuliano Bravo Rayan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ncurses (Ubuntu)
New
Undecided
Unassigned

Bug Description

Description: Ubuntu 22.04.2 LTS
Release: 22.04
libncurses6:
  Installed: 6.3-2
  Candidate: 6.3-2
  Version table:
 *** 6.3-2 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

While writting a c++ program with the library ncurses at first on Ubuntu 20.04 then I upgraded to Ubuntu 22.04. I have encountered a problem while waiting for an input from the user. The same code below works perfectly with Ubuntu 20.04 (all the controls command ^C, ^Z work) but not in Ubuntu 22.04.
Here is the code in c++
std::string DrawGame::getString(){
    std::string input;
    // let the terminal do the line editing
    nocbreak();
    echo();
    int ch = mvwgetch(cli, 1, 1);
    while ( ch != '\n' )
    {
        input.push_back( ch );
        ch = mvwgetch(cli, 1, 1);
    }
    return input;

}

Where cli is a window previously created. The problem is that the controls commands are taken as a char in the string "input" instead of stopping the program with ^C for example. Same for ^Z.

I report this as a bug becouse there is no problem on Ubuntu 20.04.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.