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

Running From Console Ignores Input and Output Redirection #23

Open
airbreather opened this issue Jan 7, 2017 · 0 comments
Open

Running From Console Ignores Input and Output Redirection #23

airbreather opened this issue Jan 7, 2017 · 0 comments

Comments

@airbreather
Copy link

Repro Steps

  1. Create a file "bl.txt" containing just a single ASCII-encoded Windows newline.
  2. Run in a command prompt, or do the equivalent from a console application: "BSAopt x64.exe" -criticals -skiphashcheck -processhidden -copy -game sk C:\Path\To\File.bsa C:\Path\To\Output <bl.txt >NUL 2>NUL

Expected

  1. No output is displayed on the command line, because it's redirected.
  2. The application should terminate because the process should have read the newline from the file.

Actual

  1. Console spam is still present.
  2. The application sticks around.

Workarounds

  1. I can sorta work around the console spam by spawning an entirely new instance of the command prompt to run the command to keep the original console's output clean, though with the Windows 10 console overhaul, conhost.exe wastes a perhaps surprising amount of CPU cycles when running several at once.
  2. I can work around the "press enter" issue by prefixing the command line with echo. | .

I haven't yet figured out a way to work around both at once without resorting to running it through something like AutoHotkey.

Use Case

I kinda wanted to run BSAopt to extract BSA file content as part of an unattended Skyrim setup process, but neither spamming the original console nor forcing user input are acceptable, and making an AutoHotkey script just to work around both issues winds up being more annoying than just reimplementing the parts I care about in C#.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant