Skip to content

Apothic-AI/shell-terminal-title

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

shell-terminal-title

Universal shell script that adds a title command for setting terminal window titles in both Zsh and Bash.

Features

  • title "Your Title" sets a custom terminal title.
  • Re-applies your custom title before each prompt so other prompt hooks do not overwrite it.
  • Works in both Zsh and Bash.

Install

  1. Copy termtitle.sh to a location such as ~/bin/termtitle.sh.
  2. Source it from your shell config:

Zsh (~/.zshrc)

source ~/bin/termtitle.sh

Bash (~/.bashrc)

source ~/bin/termtitle.sh
  1. Reload your shell:
source ~/.zshrc
# or
source ~/.bashrc

Usage

title "My Session"

Notes

  • In Bash, the script appends a refresher to PROMPT_COMMAND and removes default PS1 title escape sequences.
  • In Zsh, the script installs a precmd hook.

About

Easily set the terminal title in zsh and bash

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages