Skip to content
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

bash-it emits bashdb error without bashdb installed #992

Closed
ravenhall opened this issue Jun 29, 2017 · 10 comments
Closed

bash-it emits bashdb error without bashdb installed #992

ravenhall opened this issue Jun 29, 2017 · 10 comments

Comments

@ravenhall
Copy link
Contributor

Just pulled from master and now I'm seeing this error when launching bash:

bash: /usr/share/bashdb/bashdb-main.inc: No such file or directory
bash: warning: cannot start debugger; debugging mode disabled

I'm on Red Hat Enterprise Linux Server release 7.3 (Maipo).
bashrc.txt
bash_profile.txt
bash-itplugins.txt

@nwinkler
Copy link
Member

It looks like this is related to this line: https://github.com/Bash-it/bash-it/blob/master/lib/preexec.bash#L122

shopt -s extdebug > /dev/null 2>&1

References:

Skimming through these, it looks like this error is caused by the above line on specific versions of Bash. The issues describe it in the context of iTerm2, which uses a similar preexec integration script.

Not sure how to fix it - the above links contain a couple of potential workarounds, but I don't have a system to test this...

@ravenhall
Copy link
Contributor Author

I can test if a solution can be sussed out from those threads. The only clear workaround I see is checking if bashdb is installed in the preexec_install() function before setting the DEBUG trap on L130.

Installing a VM with CentOS 7.2 and then bash-it exhibits the same behavior.

@ravenhall
Copy link
Contributor Author

It looks as though another potential could be that a failed check for bashdb could run shopt -u extdebug to disable the external debugger.

@ravenhall
Copy link
Contributor Author

ravenhall commented Jul 12, 2017

There is an interesting article on Season of Code with a description of how the DEBUG trap and PROMPT_COMMAND can be employed to emulate zsh's preexec hook. The page notes that a PS0 variable patch that simplified this was accepted into Bash 4.4.

How should bash-it handle this?

  1. Check for Bash 4.4 and use a PS0 implementation only
  2. Check for Bash 4.4 and use PS0 implementation with fallback to DEBUG/PROMPT_COMMAND
  3. DEBUG/PROMPT_COMMAND only (current solution)

@ravenhall
Copy link
Contributor Author

ravenhall commented Jul 12, 2017

Additionally, I am not sure that the current implementation is working as expected. It looks as though the preexec_invoke_exec hook is being executed three times after the command is invoked due to the pipelined command prompt_command;__vte_prompt_command;preexec_invoke_cmd which is in RedHat's /etc/bashrc.

preexec_invoke_exec.txt

@nshiell
Copy link

nshiell commented Feb 24, 2020

I have this issue on KDE Neon
Linux saturn 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

What's the best way to remove this?

@NoahGorny
Copy link
Member

hey @nshiell
are you still experiencing this bug?

@hv15
Copy link

hv15 commented Dec 7, 2020

Hi, I get this on CentOS 7 using Bash 4.2.46(2)-release using the latest version of bash-it.

@NoahGorny
Copy link
Member

seems like the solution is to install bashdb, and the error should go away.

Feel free to reopen if it does not help

@palladius
Copy link

Same here, on Mac:

./blah.sh: /opt/homebrew/Cellar/bash/5.2.15/share/bashdb/bashdb-main.inc: No such file or directory

I believe the issue was:

#!/bin/bash

set -euo pipefail

I changed it to

#!/bin/bash

and the shebang worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants