desmume icon indicating copy to clipboard operation
desmume copied to clipboard

Feature request: Add option to output console text to origin CMD window

Open mariomadproductions opened this issue 6 months ago • 7 comments

State your operating system:

Windows.

DesMuME version

git master

Issue

I have a ROM that produces debug output. At the moment, I can view that from desmume's own CMD window. But I need to be able to redirect it to another process or file, for further processing in real-time. So could the option to output to the CMD window the desmume.exe is started from be added? That way I can do something like desmume | my_script.

mariomadproductions avatar May 11 '25 21:05 mariomadproductions

this should already work. but you may have been deceived by something I just pushed a fix for

zeromus avatar May 11 '25 21:05 zeromus

this should already work. but you may have been deceived by something I just pushed a fix for

Ah no I saw that commit after I had this issue. desmume doesn't seem to print to the parent CMD window at all on Windows.

mariomadproductions avatar May 12 '25 09:05 mariomadproductions

it will absolutely print to stdout if you pipe or redirect it. or maybe you have to redirect it TOO, if you want to pipe it. 1>CON | pipeprog for instance

zeromus avatar May 12 '25 18:05 zeromus

it will absolutely print to stdout if you pipe or redirect it. or maybe you have to redirect it TOO, if you want to pipe it. 1>CON | pipeprog for instance

It seems like if I redirect to file/pipe to another process, it does sort-of work. It only flushes the data very occasionally, making it not really usable "live".

mariomadproductions avatar May 12 '25 19:05 mariomadproductions

I did some investigation when I wrote about it here and that seems normal, generally. But I said I pushed a fix for it which does flush the nocash and ideas printing on every single print message (because that's a special case). How are you sending the messages? lua prints?

zeromus avatar May 12 '25 19:05 zeromus

I did some investigation when I wrote about it here and that seems normal, generally. But I said I pushed a fix for it which does flush the nocash and ideas printing on every single print message (because that's a special case). How are you sending the messages? lua prints?

That seems to have fixed it. I'm playing a ROM hack, I think its probably using its own nocashprint function.

Also, I noticed that desmume freezes after a few seconds if you select text in the CMD window, although it seems like that happens back in the commit before your ones - 1754c18 and also way back with v0.9.13 too.

mariomadproductions avatar May 13 '25 14:05 mariomadproductions

That's normal for all windows applications.

zeromus avatar May 13 '25 21:05 zeromus