{"id":40029,"date":"2022-04-24T14:31:38","date_gmt":"2022-04-24T18:31:38","guid":{"rendered":"http:\/\/technology-hates-you.com\/lm3m\/?p=40029"},"modified":"2022-04-24T21:15:02","modified_gmt":"2022-04-25T01:15:02","slug":"updating-my-bash-prompt","status":"publish","type":"post","link":"https:\/\/technology-hates-you.com\/lm3m\/40029","title":{"rendered":"Updating my bash prompt"},"content":{"rendered":"\n<p>I spend most of my days in the command line. I try to keep things as simple, closest to bare metal as possible, without installing a ton of non-system stuff.<\/p>\n\n\n\n<p>Usually this is what my prompt looks like:<\/p>\n\n\n\n<div style=\"background-color:#263238;padding:20px;\"><span style=\"color:white;\">[<span style=\"color:green;\">main<\/span>:<span style=\"color:yellow;\">\/d\/code\/cthugha<\/span>]<\/span><\/div>\n\n\n\n<p>Instead, this is what I was seeing:<\/p>\n\n\n\n<div style=\"background-color:#263238;padding:20px;\"><span style=\"color:white;\">bash: \/d\/code\/cthugha\/vcpkg\/.git\/HEAD: Not a directory\n[:<span style=\"color:yellow;\">\/d\/code\/cthugha<\/span>]<\/span><\/div>\n\n\n\n<!--more-->\n\n\n\n<p>the first bit is the branch if I am in a git repo.<\/p>\n\n\n\n<div style=\"background-color:#263238;padding:20px;\"><span style=\"background-color:#263238;padding:20px;color:green;\">main<\/span><\/div>\n\n\n\n<p>the second is the current directory.<\/p>\n\n\n\n<div style=\"background-color:#263238;padding:20px;\"><span style=\"background-color:#263238;padding:20px;color:yellow;\">\/d\/code\/cthugha<\/span><\/div>\n\n\n\n<p>It also shows the name of the machine if I am logged on not on the console (e.g. ssh&#8217;ed into a remote machine.)<\/p>\n\n\n\n<p>Nothing too fancy, just display some info as I navigate around. Modified from a code I <s>stole <\/s> borrowed from someone years ago. It also has some stuff in there for dealing with Python virtualenv which thankfully I don&#8217;t really deal with much anymore. <\/p>\n\n\n\n<p>Problem was that if I navigated to a git submodule I would see an error, and the git branch would be wrong. Took a few tweaks, but I was cleaned it up. What the issue was had to do with how git keeps track of submodules (which to be honest is not that surprising considering that submodules have always felt bolted on and have more than likely changed since I last updated my prompt) and once I fixed that it looks good.<\/p>\n\n\n\n<p>The issue was that the code was looking for a directory that in a submodule was actually a file. Anyway, fixed that up and it all looks good.<\/p>\n\n\n\n<p>Anyway, here is my .bash_prompt if it is any use to anyone: <a href=\"https:\/\/gist.github.com\/lm3m\/d6118ffc350f68807e5019b61c43f3a8\" target=\"_blank\" rel=\"noreferrer noopener\">.bash_prompt<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spend most of my days in the command line. I try to keep things as simple, closest to bare metal as possible, without installing a ton of non-system stuff. Usually this is what my prompt looks like: [main:\/d\/code\/cthugha] Instead, this is what I was seeing: bash: \/d\/code\/cthugha\/vcpkg\/.git\/HEAD: Not a directory [:\/d\/code\/cthugha]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[580,274,581],"class_list":["post-40029","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bash","tag-code","tag-dork"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1AdCf-apD","jetpack-related-posts":[{"id":39844,"url":"https:\/\/technology-hates-you.com\/lm3m\/39844","url_meta":{"origin":40029,"position":0},"title":"Cthugha lives!","author":"lm3m","date":"2020.05.12 at 07:10 PM","format":false,"excerpt":"I have been a touch distracted and not able to write much since the beginning of 2020 and it has only continued into the Coronavirus-lockdown-hell. In an attempt to recover some sort of focus, I have decided to revive an old software project: CTHUGHA For those of you who don't\u2026","rel":"","context":"In &quot;CTHUGHA-Journal&quot;","block_context":{"text":"CTHUGHA-Journal","link":"https:\/\/technology-hates-you.com\/lm3m\/category\/cthugha-journal"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-12-at-2.04.50-PM.png?fit=1200%2C961&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-12-at-2.04.50-PM.png?fit=1200%2C961&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-12-at-2.04.50-PM.png?fit=1200%2C961&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-12-at-2.04.50-PM.png?fit=1200%2C961&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-12-at-2.04.50-PM.png?fit=1200%2C961&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":39851,"url":"https:\/\/technology-hates-you.com\/lm3m\/39851","url_meta":{"origin":40029,"position":1},"title":"CTHUGHA and OpenGL","author":"lm3m","date":"2023.09.22 at 08:46 AM","format":false,"excerpt":"So, to recap, I decided to revive an old piece of software, because corona-virus induced sheltering in place had left me a little bonkers. Last update I talked about how I got it at least limping along. Before I went too far, I set out some goals: Cross-platform - has\u2026","rel":"","context":"In &quot;blog&quot;","block_context":{"text":"blog","link":"https:\/\/technology-hates-you.com\/lm3m\/category\/blog"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-21-at-3.43.28-PM-e1696192242105.png?fit=503%2C375&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":336,"url":"https:\/\/technology-hates-you.com\/lm3m\/336","url_meta":{"origin":40029,"position":2},"title":"finding infinity","author":"lm3m","date":"2011.11.14 at 06:08 PM","format":false,"excerpt":"Your science makes my story uninteresting. Me in conversation with myself while reading some articles --- Working at home may drive me batty, but on days where I can go out and get a fresh mango and chop it up in my own kitchen it is pretty cool. And, since\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"IMG_0971","src":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2011\/11\/IMG_0971_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":96,"url":"https:\/\/technology-hates-you.com\/lm3m\/96","url_meta":{"origin":40029,"position":3},"title":"Jumping the shark","author":"lm3m","date":"2011.01.10 at 09:07 AM","format":false,"excerpt":"\u00a0 Egyptian beaches were being terrorized by a series of shark attacks. According to some reports, it was supposedly an Israeli trained attack shark. But, the terror is over after the shark was slain by a drunken Serb, who literally jumped the shark. Pure awesomeness. If this news report is\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"sharkserb","src":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2011\/01\/sharkserb_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":324,"url":"https:\/\/technology-hates-you.com\/lm3m\/324","url_meta":{"origin":40029,"position":4},"title":"google has metro envy","author":"lm3m","date":"2011.11.2 at 11:04 AM","format":false,"excerpt":"Wow, not very often you see a company fully admit they are completely jealous of another, but with the conversion of every thing google (reader, gmail, the google header on all google pages, even the search page) to the google+ look (flat text driven with a good amount of white\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":39959,"url":"https:\/\/technology-hates-you.com\/lm3m\/39959","url_meta":{"origin":40029,"position":5},"title":"Iceland R\u00e9tts\u00e6lis, Day 2: A rock, another rock, and some seals","author":"lm3m","date":"2021.08.18 at 06:35 PM","format":false,"excerpt":"So, some house keeping to get things started. One, the title of this trip is Iceland R\u00e9tts\u00e6lis which is a reference to the direction we are traveling, \u2018r\u00e8tts\u00e6lis\u2019 is clockwise in Icelandic\u2014or so the Googles say, and we are traveling that way from Reykjavik. It is not the typical direction,\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2021\/08\/img_3291-scaled.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2021\/08\/img_3291-scaled.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2021\/08\/img_3291-scaled.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2021\/08\/img_3291-scaled.jpg?resize=700%2C400 2x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2021\/08\/img_3291-scaled.jpg?resize=1050%2C600 3x, https:\/\/i0.wp.com\/technology-hates-you.com\/lm3m\/wp-content\/uploads\/2021\/08\/img_3291-scaled.jpg?resize=1400%2C800 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/posts\/40029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/comments?post=40029"}],"version-history":[{"count":15,"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/posts\/40029\/revisions"}],"predecessor-version":[{"id":40044,"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/posts\/40029\/revisions\/40044"}],"wp:attachment":[{"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/media?parent=40029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/categories?post=40029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technology-hates-you.com\/lm3m\/wp-json\/wp\/v2\/tags?post=40029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}