Reputation: 1
I'm using this code, compiling with nasm and linking with alink. Whenever I run the resulting exe in bash it spawns a new console separate from the existing command shell. How would I write a program that uses the original console it was executed within rather than spawning a new console?
Upvotes: 0
Views: 77
Reputation: 36348
From the code:
;; Since this is a Windows subsystem program, we need to allocate a console,
;; in order to use one.
call [AllocConsole]
In other words, it is quite explicitly creating a brand new console. To make it use the existing console, link it as a Console subsystem application rather than a Windows subsystem application, and remove the call to AllocConsole().
Upvotes: 3