As steeldriver said, this is the symptom of a long-running process. Since it is nvm, this is completely reasonable. nvm caused my shell to take significantly longer to start as it tries to load a bunch of files from disk.
Try pressing CTRL+C (multiple times if it doesn't work, then CTRL+\) at that prompt to cancel the long-running command (usually nvm). You should end up at your normal prompt, possibly without color. When Linux runs a terminal command, the terminal subsystem buffers the input and echoes it before sending it to any application, unless the specific command bothered to disable echo.
As Raffa said, the problem is inside ~/.bashrc
. See https://github.com/nvm-sh/nvm/issues/782 , https://stackoverflow.com/questions/23556330/run-nvm-use-automatically-every-time-theres-a-nvmrc-file-on-the-directory , and https://github.com/nvm-sh/nvm/issues/1261 . I personally use something like the following edit to my .bashrc
:
# Comment out the lines the nvm installer added by default
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#. <(npm completion)
Only load nvm when necessary
alias nvm='unalias nvm && . "$NVM_DIR/nvm.sh" && nvm'
alias node='unalias node && . "$NVM_DIR/nvm.sh" && node'
This may cause some subtle bugs, but it greatly reduces the impact of nvm on my terminal startup time. This is especially useful for working with non-Node commands.
~/.bashrc
to~/.bashrc_disabled
and relaunch your terminal to see if it becomes normal again. – Raffa Jan 18 '24 at 18:43~/.bashrc
, assuming you are using the default terminal profile) – steeldriver Jan 18 '24 at 18:43