![]() This was also the case when directly opening Ubuntu in WSL. The ~\.bashrc file wasn’t being executed when a new Linux Tab was created in Windows Terminal. I was also greeted by a new, prettier looking prompt - ohmyposh! My theory held true. The series of echo statements printed into the terminal immediately. Tip: The source command reads and executes the commands within a file, so would certainly load the ~\.bashrc file, and set the desired configurations.īecause of its nature,you make sure that you’re only using the source command on a file where you trust the contents! To achieve this I executed the command source ~\.bashrc in the Ubuntu tab that had already been opened. This led me to the conclusion that ~\.bashrc wasn’t being executed. I was surprised to find that none of my new echo statements were being invoked. I shut down the WSL environment by using wsl.exe -shutdown and reopened a new Linux Tab in the Windows Terminal to ensure this was a fresh instance. The troubleshooting step? It’s of course the highly-advanced (sarcasm intended!) use of echo statements throughout the script to identify at what stage the script is failing. Let’s figure out how far the script is able to execute and debug from there. It must be failing to execute mid-way through. Clearly, there was something in my ~\.bashrc preventing the full file from executing. ![]() My next troubleshooting step is likely the one that most of you would try next. Windows Terminal not showing any ohmyposh configuration There was no pretty prompt, and my aliases were not working. I made the changes to my ~\.bashrc file as suggested throughout several blog posts and docs, but nothing seemed to reflect the modifications to ~\.bashrc when a new shell was created. There had to be something else going on in my environment. I’ve followed the same post before, so I know that it works. I was following one of his posts, but couldn’t seem to get the prompt working successfully. ![]() Scott Hanselman has done a brilliant write-up on how you can get this setup in your environment. Tip: If you haven’t heard of ohmyposh, then it’s worth looking into. My goal was to have a consistent usability experience configured across the PowerShell and Ubuntu environments, considering tools such as ohmyposh. I’ll talk about other issues that I’ve been working on fixing in separate blog posts. Nothing significant, but several papercuts that kept getting in the way of my productivity. Hence why Windows Subsystem for Linux, Windows Terminal and Ubuntu are my go-to local command-line tools.Īs you’ll have guest from the title of this post, I’ve been having some issues with my Ubuntu environment. I’ve built up a bit of a natural preference for the Linux command-line over that time, so it now comes more naturally to me. From my university days, the computer terminals were all Linux-based (I think a flavour of Debian?), and I used a MacBook Pro throughout my time at university as well. If you aren’t familiar with it, or want some productivity tips - I definitely recommend checking out the post!įor my local development, I typically use Ubuntu in Windows Subsystem for Linux. I’ve written another blog post on how it can make you productive with Azure. Windows Subsystem for Linux is the focus for this post. Windows Terminal and Windows Subsystem for Linux (WSL) are a couple of the key tools in my local development environment. I’m working on a few ideas, but if you have any suggestions - please throw them my way! To prepare for this, I’ve recently spent some time making sure my local development environment is in order. In case you haven’t heard, I’m planning to do some livestreams in the near future which are focused on live development / building in the cloud.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |