jml / undistract-me

Notifies you when long-running terminal commands complete
Other
540 stars 48 forks source link

bash preexec hack causes unnecessary debugger triggering #58

Open yunake opened 5 years ago

yunake commented 5 years ago

With UDM installed, running a shell script interactively causes debugger traps to activate for any non-zero exit status inside the script. This will either spawn a bashdb session, or if it's not installed it will complain about it missing like so:

yunake@core:~$ xrandr-current-output
/home/yunake/bin/xrandr-current-output: /usr/share/bashdb/bashdb-main.inc: No such file or directory
/home/yunake/bin/xrandr-current-output: warning: cannot start debugger; debugging mode disabled
DP1
yunake@core:~$ 

Of course, having the debugger installed is even worse since it means the script will drop into interactive debugging session and fail to complete.

I don't know how to fix this properly — I don't see a way to implement pre-exec hack in such a way that doesn't trigger debugger as a side effect.

As a work-around, one can simply create empty debugger hook file, this will suppress the messages:

mkdir /usr/share/bashdb
touch /usr/share/bashdb/bashdb-main.inc
linnabraham commented 4 years ago

bash: preexec_set_exit: command not found I get this error when becoming root using su.