Skip to content

Debug console

zero-plusplus edited this page Dec 22, 2021 · 2 revisions

debug-console

Displays various messages during debugging. Press Ctrl + Shift + y if you want to use it.

Message from Debug adapter

Besides the announcements from the debug adapter, you can output messages to the debug console yourself in the following ways.

Message from AutoHotkey

You can output messages from the script to the debug console in the following ways.

About error message

The debug adapter modifies the format of the file name and line number in the error messages output by AutoHotkey. This allows VSCode to recognize it as a link and allows the user to jump to the source of the error.

However, not all errors are output to the debug console and If a runtime error occurs, the error message is basically only shown in a dialog box. This doesn't allow you to jump to the source of the error using a link.

If this is inconvenient for you, you can include this library in your scripts. The library will catch all errors and output a message to the debug console in the same format as the actual error messages.

If you encounter a bug in this library, please comment at the link.

About Multi-byte garbled characters(or mojibake)

AutoHotkey error messages do not output a multi-byte string well. However, in version 1.1.33.00, the #ErrorStdOut directive and the /ErrorStdOut switch has been extended to allow UTF-8 output, which resolves this issue.

If this feature is available, it is enabled by default and the user does not need to be aware of it. However, if you have set runtimeArgs, you need to add "/ErrorStdOut=UTF-8" manually.