According to the bash manual (emphasis mine):

The value is the prompt printed before the command line is echoed when the -x option is set (see The Set Builtin). The first character of PS4 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is ‘+ ’.

Is there a way to disable this behavior? I thought of cursor left (\b), but bash seems to only consider the literal first character (\).

  • 1
    Make it the null character?
    – DopeGhoti
    Jun 21 '17 at 15:50

You can set PS4 to have its first character to be NUL, which takes no space on screen:

export PS4="\000 "

You will then have no visual indication of how deeply-nested the commands in question are.


@DopeGhoti's answer did not work for me but this did


It moves the cursor 0 characters to the left, so it's basically a NOOP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.