SoptikHa2 / desed

Debugger for Sed: demystify and debug your sed scripts, from comfort of your terminal.
https://soptik.tech/articles/building-desed-the-sed-debugger.html
GNU General Public License v3.0
1.12k stars 22 forks source link

Add timeout to sed, aborting if it takes too long and guessing where the infinite loop might be #13

Open SoptikHa2 opened 4 years ago

SoptikHa2 commented 4 years ago

When one makes an error in script and loads it with desed or presses l to reload source code, and the sed script makes sed enter infinite loop, desed hangs and trusts sed to actually exit. We shouldn't assume everything will be ok and after a while just exit with an error. It would be great if we could actually try to guess where did sed loop so we can point user at that.

SoptikHa2 commented 4 years ago

One way: if we loaded output from sed asynchronously, we could just stop reading after n states. This would also enable user to nicely debug where and why is the infinite loop there. It would be best if we could add way to send warnings from debugger straight to TUI, so we can warn user that full sed state wasn't loaded, probably due to infinite loop.