0

At the very end of .bashrc I do echo "The END". But even after this statement gets printed, there is a huge delay sometimes more than 5 seconds, to get the PS1 prompt.

How can I diagnose this? Any suggestions?


Tried Solutions

  • I did bash -x. The last output is indeed The END.
  • I changed prompt variable to just PS1='$ ', but this has no effect.
Porcupine
  • 1,680
  • 2
  • 19
  • 45
  • 1
    @Jesse_b: I did `bash -x`. The last output is indeed `The END`. – Porcupine Jan 04 '20 at 23:31
  • 3
    Some other things to check for are `PROMPT_COMMAND` Perhaps there is something in there that takes time, or your `PS1` prompt itself may have some command in it that takes time to execute. Either way this would likely cause your prompt to be slow every time and not just the first time it loads, but there are possibly some commands that run much quicker on subsequent executions. – jesse_b Jan 04 '20 at 23:41
  • @Jesse_b It is still taking a lot of time. The only statement relating to PS1 is PS1='$ ' – Porcupine Jan 06 '20 at 08:29
  • Try `strace -tt -fo strace.log bash` to see if it gives you any clue (in `strace.log`). Does `bash --norc` have a similar delay? – Stéphane Chazelas Jan 06 '20 at 17:23

0 Answers0