Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging -help output #962

Open
thrust26 opened this issue Mar 18, 2023 · 11 comments
Open

Paging -help output #962

thrust26 opened this issue Mar 18, 2023 · 11 comments
Milestone

Comments

@thrust26
Copy link
Member

thrust26 commented Mar 18, 2023

With the ever increasing number of features and resulting command line parameters, the output for -help has become quite large. Therefore we should page the help text, where the output stops after each page.

I tried to do this for windows, but the way Windows attaches a console to a GUI app is crazy. 😒 Also MSVS behaves different between Debug and Release mode, so I cannot even debug the problems. 😠 Whatever I tried, it always resulted into having to press Enter twice and original console command prompt cluttering the output. E.g.:
image

@sa666666
Maybe this can be easier added at least for Linux and MacOS?

@thrust26 thrust26 added this to the Prio 2 milestone Mar 18, 2023
@DirtyHairy
Copy link
Member

Hm, that would be highly unusual behaviour on UNIX. Many, many programs have help output that exceeds a typical screen, and the usual thing to do is to just pipe the output through less (or more).

@thrust26
Copy link
Member Author

Yes, Windows is special here. A GUI doesn't have any console output by default. So you have to attach a separate console. And then you can redirect stdout and stderr to that console. But for whatever reason, stdin doesn't work. From searching the web I found that Microsoft has changed (or broken?) this.

@sa666666
Copy link
Member

I was going to say the same as @DirtyHairy. This is more properly handled by the shell/console from which Stella is launched, not by the app itself.

@thrust26
Copy link
Member Author

Not with Windows and MSVS. Without attaching a separate console, there is NO console output at all in a GUI application like Stella.

thrust26 added a commit that referenced this issue Mar 18, 2023
@thrust26
Copy link
Member Author

@sa666666 @DirtyHairy
I just committed code which should work with Linux and MacOS. It compiles but can you give it a try please?

@sa666666
Copy link
Member

Hmm, I left a comment, and now it's gone. I originally said that this is working fine in Linux (KDE/konsole shell). And bonus points that it still works with less and more.

@thrust26
Copy link
Member Author

Thanks, I was worried that I might have broken something.

For Windows the really working solution seems to require to create two programs. A prime example is MSVS, it has devenv.com and devenv.exe. From the command line, using devenv defaults to the .com version, which is a console app. If required devenv.com calls devenv.exe.

Another alternative would be use a GUI window for the console output. devenv.exe -? does that.

But I think both solutions might be overkill. @sa666666 Thoughts?

BTW: Meanwhile I added something similar for the debugger's PromptWideget (dc780d8).

@sa666666
Copy link
Member

For Windows the really working solution seems to require to create two programs. A prime example is MSVS, it has devenv.com and devenv.exe. From the command line, using devenv defaults to the .com version, which is a console app. If required devenv.com calls devenv.exe.

This is exactly what I do with the HarmonyCart app. Two versions are included; one is GUI-based, the other is used on the commandline (automatically, as you describe). I never did find another way to do it. If you can, that would be great.

I don't know if it's worth the effort for Stella, though. For HarmonyCart, there's specific functionality at the commandline. In Stella, it's just showing the help screen.

@thrust26
Copy link
Member Author

In Stella, it's just showing the help screen.

Plus listrominfo and rominfo. 😄

If we create such a 2nd app, how would one setup MSVS? Can both be combined into one solution?

@sa666666
Copy link
Member

Not that I know of. I never did find a solution beyond just compiling two versions of the app, and naming one with .exe and the other with .com.

@thrust26
Copy link
Member Author

I think its not worth the extra effort. At least not now.

@thrust26 thrust26 modified the milestones: Prio 2, Prio 3 Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants