@@ -129,6 +129,7 @@ _Dbg_parse_options() {
129
129
130
130
typeset -i _Dbg_o_quiet=0
131
131
typeset -i _Dbg_o_version=0
132
+ typeset -i _Dbg_highlight_enabled=1
132
133
133
134
while getopts_long A:Bc:x:hL:nqTt:Yy:VX opt \
134
135
annotate required_argument \
@@ -176,10 +177,12 @@ _Dbg_parse_options() {
176
177
177
178
if (( ! _Dbg_have_working_pygmentize )) ; then
178
179
printf " Can't run pygmentize. --highlight forced off" >&2
180
+ _Dbg_highlight_enabled=0
179
181
_Dbg_set_highlight=' '
180
182
fi
181
183
;;
182
184
no-highlight )
185
+ _Dbg_highlight_enabled=0
183
186
_Dbg_set_highlight=' ' ;;
184
187
init-file )
185
188
set -x
@@ -249,25 +252,24 @@ welcome to change it and/or distribute copies of it under certain conditions.
249
252
fi
250
253
unset _Dbg_o_annotate _Dbg_o_version _Dbg_o_quiet
251
254
_Dbg_script_args=(" $@ " )
252
- }
253
255
254
- if (( _Dbg_have_working_pygmentize )) && [[ -z " $_Dbg_set_highlight " ]] ; then
255
- # Honor DARK_BG if already set. If not set, set it.
256
- if [[ -z " $DARK_BG " ]] ; then
257
- . " ${_Dbg_libdir} /init/term-background.sh" > /dev/null
258
- fi
256
+ if (( _Dbg_have_working_pygmentize )) && (( _Dbg_highlight_enabled )) && [[ -z " $_Dbg_set_highlight " ]] ; then
257
+ # Honor DARK_BG if already set. If not set, set it.
258
+ if [[ -z " $DARK_BG " ]] ; then
259
+ . " ${_Dbg_libdir} /init/term-background.sh" > /dev/null
260
+ fi
259
261
260
- # DARK_BG is now either 0 or 1.
261
- # Set _Dbg_set_highlight based on DARK_BG
262
- # Note however that options processing has one more chance to
263
- # change _Dbg_set_highlight
264
- if (( $DARK_BG )) ; then
265
- _Dbg_set_highlight=" dark"
266
- else
267
- _Dbg_set_highlight=" light"
262
+ # DARK_BG is now either 0 or 1.
263
+ # Set _Dbg_set_highlight based on DARK_BG
264
+ # Note however that options processing has one more chance to
265
+ # change _Dbg_set_highlight
266
+ if (( $DARK_BG )) ; then
267
+ _Dbg_set_highlight=" dark"
268
+ else
269
+ _Dbg_set_highlight=" light"
270
+ fi
268
271
fi
269
- fi
270
-
272
+ }
271
273
272
274
# Stand-alone Testing.
273
275
if [[ -n " $_Dbg_dbg_opts_test " ]] ; then
0 commit comments