Zhus on First

(software-carpentry) following the CL breadcrumbs

I've been testing out warp and initially set it up to autocomplete suggestions using tab.

Convenient, right?

It turns out it's too convenient.

As I completed some assignments and it got into mid-afternoon, I started getting click happy, and in one instant:

Tab-->Enter

And what was the auto-suggestion that I accepted: pip3 install requests.

An innocuous enough of a library to install, but it wasn't what I wanted. So then the hour long command-line fun began:

  1. how do i uninstall it?

  2. how do i check what else got installed?

  3. how do i make sure i'm uninstalling the right copy, the right version? what if i uninstall something critical?

I've been using various ai-chats to extend and boost my programming learning. And it's not some isolated .py or .java file I'm messing with or a github repo. I knew some of the changes could be a one way road. With warp's history and Claude's recent boosts, I knew it was relatively safe. So kept going:

  1. i'm just using uv right now? what if i could just prevent pip commands from executing? could i change warp's settings to prevent certain commands? Claude gave some generic and then some non-existent options.

  2. but if warp still just uses the system's zsh, couldn't i block it at a system level?

  3. oh wait, but there's something going on with my $PATH setup. echo pip3 and python3 points back to the os python? but i had pinned a custom python globally.

  4. is it where i wrote the commands? what are the differences between .zshenv, .zprofile, .zshrc, .zlogin? turns out there is an order to the madness: shell files

  5. some more echo $PATH and which python3 checks, and this when I came across some regex like commands like echo $PATH | tr ':' '\n' | head -5 -->oh it's not regex. it's a pipe operator. wow, the original UNIX folks knew how to name things.

  6. so i got the PATH all checked out, and this is when claude, knowing the full context, suggested:

  7. Missing symlink: The python3 symlink might not exist in /.local/bin/

  8. Shell cache: Your shell might be caching the old location

  9. Different executable name: Maybe it's named python3.12 instead of python3

lo and behold, i did uv install python 3.12 and set it all specifically as python 3.12. there was no generic symlink so python3 was calling the system python, and it didn't matter how good my $PATH sequence was.


Did any of this make sense to you? Exact sequencing aside, I hope it's evident how much fun it was to learn and figure all this stuff out, and instead of digging through docs, it was fun having an ai as a trouble-shooting (hesitate to say thought) partner.

I hope to learn more about UNIX fundamentals and sys admin.

P.S. I changed the keybinding in Warp to use "Shift -->" and also added this to my .zshrc:

echo '
# Block pip commands
pip() {
    echo "❌ Use '\''uv add'\'' instead of '\''pip install'\''"
    echo "📖 See: https://docs.astral.sh/uv/pip/"
    return 1
}

pip3() {
    echo "❌ Use '\''uv add'\'' instead of '\''pip3 install'\''"  
    echo "📖 See: https://docs.astral.sh/uv/pip/"
    return 1
}' >> ~/.zshrc

#software-carpentry