Distro: Ubuntu-18.04 (running on Windows 10 WSL2)
My terminal for any new Ubuntu instance is completely frozen with the message "Vim: Warning: Output is not to a terminal"
This happened after editing the .bashrc file on VIM where all I did was add in an alias for some ls command. Once I entered source .bashrc
, the above message showed up. I am unable to ctrl+C or ctrl+z my out of anything and no prompts show up to allow for any command typing.
It's almost certain I made some sort of mistake while editing the .bashrc file but I'm unable to even view that file, let alone edit and execute it. Any way to fix this issue other than reinstalling the whole distro?
Edit 1: I'm able to see the bashrc file through Windows File Explorer. Here is a portion of it:
The only part that I edited was adding a new alias called starship, so just this part:
alias starship='vi ~/.config/starship.toml'
Looks like correct syntax to me, so now I'm even more confused why this issue is happening.
Edit 2: The terminal hanging just stopped after a while and now I'm able to do work on the terminal again. I didn't really do anything to it, just waited. My guess the issue had nothing to do with the alias addition and was something to do with Starship prompt program.
Edit 3: Answer given by NotTheDr01ds perfectly solved the issue. And as brought up by muru, the alias most definitely caused the issue in the first place, where I overrode the command eval "$(starship init bash)"
(at the bottom of the bashrc file) as a result of the new alias called starship.
starship
command that's used for your prompt, and you created astarship
alias that overrides that command to runvi
instead?