I understand that set -x gets a Bash user into debug mode and I feel that working full time in debug mode will help me handle possible problems better in Bash.
I experience a problem when working with set -x:
When I try to use the native tab completion of my distro (Ubuntu 16.04) to complete a directory's name, I get a very long, messy output.
For example, $PWD is /var/www/html/ and I run either of these:
cd ~/u[tab completion to complete u to ulcwe]
cd ~ && cd u[tab completion to complete u to ulcwe]
In both examples I'll get a very long and messy output:
+ return 0
+ local -a toks
+ local quoted x tmp
+ _quote_readline_by_ref '~/u' quoted
+ '[' -z '~/u' ']'
+ [[ ~/u == \'* ]]
+ [[ ~/u == \~* ]]
+ printf -v quoted '~%q' /u
+ [[ ~/u == *\\* ]]
+ [[ ~/u == \$* ]]
++ compgen -d -- '~/u'
+ x='~/ulcwe'
+ read -r tmp
+ toks+=("$tmp")
+ read -r tmp
+ [[ -d != -d ]]
+ [[ -n '' ]]
+ [[ 1 -ne 0 ]]
+ compopt -o filenames
+ COMPREPLY+=("${toks[@]}")
+ return 0
lcwe/
Note the lcwe in the end.
The above output is just part of a much larger output.
How could I keep working in debug mode full time (set -x) but without all that output when performing tab completion?