We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eef4120 commit 3e10ba8Copy full SHA for 3e10ba8
1 file changed
PasteIntoFile/Main.cs
@@ -113,10 +113,14 @@ class ArgsTray {
113
/// </summary>
114
[STAThread]
115
static int Main(string[] args) {
116
- // redirect console output to parent process, for command line help etc.
117
- // not perfect, but probably as good as it can be: https://stackoverflow.com/a/11058118
118
- AttachConsole(ATTACH_PARENT_PROCESS);
119
- Console.OutputEncoding = Encoding.UTF8;
+ try {
+ // redirect console output to parent process, for command line help etc.
+ // not perfect, but probably as good as it can be: https://stackoverflow.com/a/11058118
+ AttachConsole(ATTACH_PARENT_PROCESS);
120
+ Console.OutputEncoding = Encoding.UTF8;
121
+ } catch {
122
+ // ignored (probably non-console mode)
123
+ }
124
125
#if PORTABLE
126
// Portable settings
0 commit comments