Project

General

Profile

Actions

Bug #9177

closed

Can't exit curses program and retain screen contents

Added by walles (Johan Walles) over 10 years ago. Updated almost 10 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
[ruby-core:58691]

Description

Hi!

Please try the attached program.

Expected result:

  • After you hit some key, the program should quit and the "Hit any key" message should still be visible on screen

Current result:

  • When the program exits, the screen contents is restored to what it was before the program was started

Note:

  • If you kill -9 the program, it exits without restoring the screen contents just like I want, but then it exits with a non-zero return code.

The use case is that I want my pager implementation to be able to exit without restoring screen contents when pressing ^C:
https://github.com/walles/moar

I currently use the kill -9 workaround, but would like to be able to do without it.

Regards /Johan


Files

curses-no-close.rb (227 Bytes) curses-no-close.rb Repro. "Hit any key" should remain on screen after it's done. walles (Johan Walles), 11/29/2013 09:36 PM

Updated by phasis68 (Heesob Park) over 10 years ago

You can use Process.exit! in such a situation.

Try appending "Process.exit!(0)" at the end of your code.

Updated by hsbt (Hiroshi SHIBATA) about 10 years ago

  • Status changed from Open to Third Party's Issue

curses is extracted from ruby-core. Please report this issue to https://github.com/ruby/curses

Updated by walles (Johan Walles) almost 10 years ago

Hiroshi SHIBATA wrote:

curses is extracted from ruby-core. Please report this issue to https://github.com/ruby/curses

Done:
https://github.com/ruby/curses/issues/5

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0