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

Contuliano Bravo Rayan 2015062 at bugs.launchpad.net
Mon Apr 3 09:46:49 UTC 2023


Public bug reported:

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.

** Affects: ncurses (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ncurses in Ubuntu.
https://bugs.launchpad.net/bugs/2015062

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

Status in ncurses package in Ubuntu:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ncurses/+bug/2015062/+subscriptions




More information about the foundations-bugs mailing list