Forum: Ruby-core [ruby-trunk - Bug #9177][Open] Can't exit curses program and retain screen contents

044324c258437649fa6438f91a3762b4?d=identicon&s=25 walles (Johan Walles) (Guest)
on 2013-11-29 13:37
(Received via mailing list)
Issue #9177 has been reported by walles (Johan Walles).

----------------------------------------
Bug #9177: Can't exit curses program and retain screen contents
https://bugs.ruby-lang.org/issues/9177

Author: walles (Johan Walles)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[universal.x86_64-darwin13]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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
666b4e17b4bb0e2d999037a25f65a7cb?d=identicon&s=25 Heesob Park (phasis)
on 2013-11-29 14:08
(Received via mailing list)
Issue #9177 has been updated by phasis68 (Heesob Park).


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

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

----------------------------------------
Bug #9177: Can't exit curses program and retain screen contents
https://bugs.ruby-lang.org/issues/9177#change-43263

Author: walles (Johan Walles)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[universal.x86_64-darwin13]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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
Eabad423977cfc6873b8f5df62b848a6?d=identicon&s=25 unknown (Guest)
on 2014-02-09 07:01
(Received via mailing list)
Issue #9177 has been updated by Hiroshi SHIBATA.

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

----------------------------------------
Bug #9177: Can't exit curses program and retain screen contents
https://bugs.ruby-lang.org/issues/9177#change-45053

* Author: Johan Walles
* Status: Third Party's Issue
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[universal.x86_64-darwin13]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN
----------------------------------------
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)
044324c258437649fa6438f91a3762b4?d=identicon&s=25 unknown (Guest)
on 2014-03-26 13:11
(Received via mailing list)
Issue #9177 has been updated by Johan Walles.


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


----------------------------------------
Bug #9177: Can't exit curses program and retain screen contents
https://bugs.ruby-lang.org/issues/9177#change-45945

* Author: Johan Walles
* Status: Third Party's Issue
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[universal.x86_64-darwin13]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN
----------------------------------------
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)
This topic is locked and can not be replied to.