openflighthpc / flight-env

Manage and access HPC application environments
Eclipse Public License 2.0
0 stars 0 forks source link

Bug with exiting flight env info #9

Open megan-godfrey opened 2 years ago

megan-godfrey commented 2 years ago

I just ran flight env info gridware and hit enter. That exited out of the info but I lost the ability to see what I was typing in the terminal.

This only happened in the flight environment - I tried running /code/flight-env/bin/flenv info gridware without the flight environment active and didn't have the same problem

I tried again in the flight environment and exited using ctrl-c. Closing that way I didn't have the same problem.

ColonelPanics commented 1 year ago

Commenting on this to mention that a similar issue to this is being experienced within Flight Environments both in Flight Solo and other production scenarios.

I've attempted to investigated further but based on what I'm seeing it looks like some way that it's handing off to groff/less is at the core of the issue?

I've also tested this outside of an activated flight environment (through using the full path to flight command) and see the same behaviour.

I do not, however, necessarily have issues with being able to type but that has been experienced on some systems recently too.

VoxSecundus commented 1 year ago

My experience testing this has been inconsistent. I've tried:

I have been unable to scroll at all on the given manual page, and in most cases I am returned to my terminal. I'm unable to see what I'm typing, and entering Return prints a new PS1 prompt on the same line, instead of a newline.

Flight Env's info command hasn't been updated since it was written in 2019, and is using a (now-defunct) gem called ronn to convert strings into roff format, so is probably due for an upgrade soon.

The issue is probably with regards to the env info command not opening/closing its processes properly. The CLI behaviour is indicative of multiple processes trying to access stdout at the same time. We could either do some tinkering to fix the current implementation, or change how we are outputting these manpages to a greater degree.

ColonelPanics commented 1 year ago

From discussion: It looks like changing this line to:

Process.wait(pid)

Fixes the issue and allows the manual page to open in a more-like experience.

benarmston commented 1 year ago

The implementation of the pager in flight job is somewhat different. Might be worth seeing if you can reproduce using its implementation of paging. https://github.com/openflighthpc/flight-job/blame/master/lib/flight_job/command.rb#L108