06 minute read

How I reduced context switching with just two characters

Two tiny commands quietly replaced something I do dozens of times a day.

Ever since moving to Omarchy, I’ve had this idea that the terminal shouldn’t just be a tool you open when needed. It should be the place where most things happen.

Not out of purism. Not because GUIs are bad—although you could argue that too. But because context switching is.

The terminal as a place

Every time you jump from terminal to browser, from browser to docs, from docs back to code, you lose a bit of flow. It’s small, but it adds up. Over time, it becomes the default way of working: fragmented, reactive, slightly slower than it needs to be.

So over the past few months, I’ve been pulling things into the terminal. Small scripts. Aliases. Little utilities that remove a step. Sometimes even entire apps.

When I started with Omarchy, I used the Spotify desktop app. Shortly after, I moved to a terminal Spotify TUI. These days, I run my own Jellyfin server and use jellyfin-tui instead. Highly recommended.

Small enough to matter

Two of my most recent additions are ? and ??.

There’s something about single-character commands. You don’t think before typing them. You don’t hesitate. They become muscle memory almost immediately.

That’s the bar for tools like this. If there’s even a bit of friction, you’ll fall back to the browser.

These two passed that test.

Browsing the web inside the terminal

The ? command is a quick way to search the web.

Bash
1
$ ? mdn css border-radius 

Not because it’s more powerful than a browser—it isn’t. But it’s closer to where I already am.

I type a query, get a list of results, pick one, and read it. All inside the terminal. No new tabs. No distractions. No drifting into unrelated links.

It’s not about speed. It’s about containment. The search happens in the same environment where the problem exists.

Bash
12345678910
#!/usr/bin/env bash
query=$(printf '%s\n' "$*" | sed 's/ /+/g')
search="https://duckduckgo.com/?q=$query"
choice=$(
  w3m -dump "$search" |
  awk '/^[0-9]+\./ {title=$0} ...
  ' | fzf
)
url=$(printf '%s\n' "$choice" | awk -F' - ' '{print $NF}')
[ -n "$url" ] && w3m "https://$url"

This takes the query, sends it to DuckDuckGo, and returns a list of results inside fzf. From there, I can filter further or just move with the arrow keys.

Press enter, and the website opens—again inside the terminal.

This time the URL is passed to w3m, a terminal browser. I can scroll, follow links, and search the page without ever leaving the environment.

Is it faster to do it this way? Not always. But let’s not forget that this is also the most private way you have to browse the web. You know for sure that no images and no scripts are being loaded. It’s really just text. The way the web was meant to be back when it was created.

Asking without context switching

The ?? command leans into something slightly different: AI, through OpenCode.

It lets me ask questions without breaking my flow.

When I’m deep inside a tmux session, the last thing I want is to open a browser, log into something, and start typing there. That’s enough friction to delay the question—or ignore it entirely.

So instead, I stay where I am.

Bash
1
$ ?? how do i use border-radius 

This goes straight into opencode:

Bash
123
#!/usr/bin/env bash
echo
opencode run "$*" | sed 's/^/  /'

The answer comes back right there, in the same context where the question originated.

No tab juggling. No mental reset. Just a quick detour and back to work.

And since I’m in a tmux session, if I need to copy something I can just press PREFIX + [ to jump into the output text, move the cursor where I need, press shift + v and now I’m in line selection mode where I can just copy some code example and past where I need it.

Credit where it’s due

This wasn’t my idea.

I first saw this pattern from Mischa van den Burg. His approach to the terminal—treating it as a central workspace instead of a side tool—stuck with me.

It’s one of those ideas that feels obvious once you see it. The kind you adopt and never question again.

Good ideas tend to spread like that.

Takeaways

We usually think of improving our setup as adding bigger tools. New frameworks. Better editors. More powerful systems.

But a lot of impact comes from the opposite direction.

Tiny changes. Almost invisible ones. The kind that remove a single step, a small decision, or a moment of hesitation.

? and ?? are exactly that.

They don’t do anything you couldn’t already do. They just make it easier to stay where you are.

And that, more than anything, is what makes the terminal feel like home.

Photo of Pedro