Welcome! Type "help" for available commands.
$
Loading terminal interface...
Back to Blog

How to automatically use Warp Terminal's Subshells with "Warpify"

December 31, 2024
William Callahan

Software engineer, founder, and leadership background in finance/tech. Based in San Francisco.

terminalCLItechnology
How to automatically use Warp Terminal's Subshells with "Warpify"

Warp Terminal is a modern terminal emulator that brings powerful features to command-line workflows. One of its standout features is subshells - isolated terminal environments for different contexts. In this post, we'll explore how to automate the use of subshells using a custom configuration I call "Warpify".

What are Warp Subshells?

Warp subshells provide isolated environments where you can run commands without affecting your main terminal session. They're perfect for things like ssh'ing to a server, or looking inside a docker container (e.g., docker exec), each with their own environment variables and working directories.

How to auto Warpify Subshells

Add the snippet to the appropriate RC file in the target environment. For SSH or containers, place it on the host you're connecting to; for local nested shells, keep it in your local RC file so those inner shells are warpified automatically.

Important: Configure this on the host you're connecting to

To Warpify SSH or container sessions, add the snippet in the target environment — the machine you're connecting to (for example: a Docker container, a remote SSH server, or a VM). Place it in that user's shell startup file (~/.bashrc or ~/.bash_profile for bash, ~/.zshrc for zsh).

  • SSH: edit the remote user's RC file on the server you SSH into.
  • Docker: edit the container image or the running container's RC file.
  • Local nested shells: add it to your local RC if you want local subshells warpified.

Local nested shells: examples

“Local nested shells” are interactive shells that you launch inside the current Warp session on the same machine (not SSH, not a container). If you want these inner shells to be warpified without a prompt, add the snippet to your local RC file.

  • Switching shells locally
    • From zsh → bash: bash, bash -l
    • From bash → zsh: zsh, zsh -l
  • Elevating or switching users locally
    • sudo -s, sudo -i
    • su - otheruser, su -l otheruser
  • Dev tools that spawn subshells
    • poetry shell, pipenv shell
    • nix-shell, nix develop
    • asdf shell <tool> <version> (depending on setup)
  • Multiplexers that launch a fresh shell in new panes or windows
    • tmux new -s work, screen

What do not count as local nested shells (configure the environment you jump into instead):

  • docker exec -it <container> /bin/bash → put the snippet in the container user's RC file.
  • ssh user@host (even ssh localhost) → put the snippet on the target machine.

This protection boundary keeps the hook scoped to Warp and to interactive shells only:

# zsh (~/.zshrc)
if [[ $- == *i* && $TERM_PROGRAM == "WarpTerminal" ]]; then
  printf '\eP$f{"hook":"SourcedRcFileForWarp","value":{"shell":"zsh"}}\x9c'
fi
# bash (~/.bashrc or ~/.bash_profile)
if [[ $- == *i* && $TERM_PROGRAM == "WarpTerminal" ]]; then
  printf '\eP$f{"hook":"SourcedRcFileForWarp","value":{"shell":"bash"}}\x9c'
fi

Quick add (local-only, guarded) helpers:

# zsh (local ~/.zshrc)
cat <<'EOF' >> ~/.zshrc

# Auto-Warpify (Warp) — only in Warp and interactive zsh
if [[ $- == *i* && $TERM_PROGRAM == "WarpTerminal" ]]; then
  printf '\eP$f{"hook":"SourcedRcFileForWarp","value":{"shell":"zsh"}}\x9c'
fi
EOF
# bash (local ~/.bashrc)
cat <<'EOF' >> ~/.bashrc

# Auto-Warpify (Warp) — only in Warp and interactive bash
if [[ $- == *i* && $TERM_PROGRAM == "WarpTerminal" ]]; then
  printf '\eP$f{"hook":"SourcedRcFileForWarp","value":{"shell":"bash"}}\x9c'
fi
EOF

For Linux hosts you're connecting to (remote server or container):

# Warpify subshells in the remote environment (add to remote ~/.bashrc)
printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "bash" }}\x9c'

See the official docs for further details: Warpify Subshells.

Similar Content

HomeExperienceEducationCVProjectsBookmarksInvestmentsContactBlog
Welcome! Type "help" for available commands.
$
Loading terminal interface...

Similar Content

Related Bookmarks

LINK
July 28, 2025
Streaming Custom Data

Streaming Custom Data

Learn how to stream custom data from the server to the client.

real-time dataai sdksstreaming apis+7 more
v5.ai-sdk.dev
LINK
November 26, 2025
How I Use Claude Code & SSH on My Phone with Termux and Tailscale

How I Use Claude Code & SSH on My Phone with Termux and Tailscale

You don’t need a new startup or third-party service to use Claude Code on your phone. You just need SSH, Tailscale, and Termux. Here’s how to code fro...

claude coderemote developmentmobile development+10 more
skeptrune.com
LINK
May 8, 2025
Scout

Scout

Let Scout do it for you

productivity toolstask automationartificial intelligence+4 more
scout.new

Related Articles

BLOG
June 16, 2025
Claude Code: Automatic Linting, Error Analysis, & Custom Commands

Claude Code: Automatic Linting, Error Analysis, & Custom Commands

How to leverage Claude Code's error analysis slash-commands and create your own linting commands to automate repetitive CLI tasks.

aiclaude codelinting+12 more
William CallahanWilliam Callahan

Related Investments

INV
December 31, 2020
Vest

Vest

Vest is an application that allows investing in the US stock market in Latin America.

investment platformsseedactive+8 more
INV
December 31, 2022
AngelList

AngelList

Platform connecting startups with investors, talent, and resources for fundraising and growth.

investment platformsotheractive+8 more
aVenture

Related Projects

PRJ
repo-tokens-calculator

repo-tokens-calculator

CLI token counter (Python + tiktoken + uv) with pretty summary

clipythontiktoken+11 more
PRJ
Filey - Flag Deprecated Files Extension

Filey - Flag Deprecated Files Extension

VS Code extension for flagging deprecated files

vs codevisual studio codecursor+17 more
PRJ
Company Research TUI

Company Research TUI

Terminal-inspired company research interface with keyboard navigation

terminal uistartup terminal softwarebloomberg for startups+13 more