-
Notifications
You must be signed in to change notification settings - Fork 123
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
Lua debug output? #19
Comments
For debugger improvements, try the build from this auto workflow build. And to help with converting scripts, build the latest docs via Three things:
I would love feedback on the documentation -- anything that isn't clear, or that doesn't quite connect the dots enough, or any other thoughts, etc. Also, I hope to eventually hook up a setting to automatically break into the debugger on every error, but something's not working right with it and I was getting nowhere on it so I gave up for now. That's ok; given the new traceback ability, automatically breaking to the debugger would only be a convenience to avoid manually injecting a pause(). |
Also, just double checking -- If you're seeing nothing at all, how do you know scripts are failing? What if they aren't even getting loaded in the first place, due to maybe some issue with the Lua errors should be emitted to stdout. Of course, it's possible for code to misbehave without actually triggering any errors, in which case debugging is needed (or inject some
Also, if the debugger is enabled, then if a prompt filter or match generator fail (not sure yet exactly what kinds of failures) then it'll print a stack trace and break to the debugger. I might stop it from breaking to the debugger, though -- it seems like Just Too Late™ debugging. 😜 |
Interesting. Clink's error output is getting eaten somehow while running inside Cmder/ConEmu. It doesn't get eaten for 0.4.9, so I assume it's a problem in Clink itself. A few things:
Commenting out the But obviously I have to figure out why the output is getting eaten... |
I injected a syntax error into one Lua script, and a
I stepped through the assembly language for most of the cases. The hooked WriteFile implementation seems to be But ConEmuHk64.dll hooked WriteFile and intercepts the calls. So it seems that only Cmder is suppressing output from Clink; stock ConEmu seems to work fine. |
D'oh. I was specifically copying that file too. After trying the steps you listed, it works now. In fact, I think that's why I wasn't seeing anything.
In my testing with a build on your current master with Cmder, I ran into a bug in the npm completion script, and it output an error message to console:
I thought this might have been because I'm not using the ConEmu that comes with Cmder (201011 vs. Cmder's 191012), so I tested it with that. It still output to console. Then, I made a new cmder directory with stock user settings to see if that was messing with it, and it still output to console. It's not my build; it still outputs an error message to console with the actions build, albiet with redacted stack traces. It's very strange that our positions are reversed now. |
I am on Windows Insider though, build 20251. |
|
Interesting:
It's looking like the problems are part of Cmder, but it could also be possible that the init.bat script is merely exposing an issue in Clink. |
This line in
With that line present, there's a 30-40% chance output will be suppressed in a particular instance of cmder/cmd/clink. Aha -- and Cmder causes the same output suppression in Clink 0.4.x as it does in Clink 1.x. I copied ConEmu 200713 into the corresponding Cmder vendor directory, and 200713 also suppresses. But ConEmu by itself, or Cmder without init.bat don't suppress. Hm. |
Output is suppressed because the handle is invalid. Details:
Maybe the handle was changed after the C runtime initialized? The C runtime doesn't support the underlying handle changing after the stdio FILE structs are initialized, which happens as one of the first things while the C runtime is initialized (e.g. see Some other interesting observations:
|
Closing since the original issue was a difference between how old and new Clink were installed (and new Clink now includes an intentionally blank clink.lua file to avoid that problem in the future), and the general issue of intermittent suppressed output occurs with both old and new Clink and is somehow being induced externally from Clink. Nothing further to do in Clink itself for this issue. |
Just adding a cross-reference:
Issue #93 has the full information on stdout getting broken in Cmder. |
This is more of a question than a feature request, but I'm not seeing much of any output in the logs when it comes to loading and executing lua scripts. I'm attempting to start the process of migrating Cmder to use your fork, but I don't even know here to begin because I'm not seeing any errors in the logs even when the scripts are obviously failing. How can I get better debug information on where the lua scripts are failing?
The text was updated successfully, but these errors were encountered: