Skip to content

Customizing Window & Terminal Titles using PROMPT_COMMAND: Examples #24

Description

@CipherCloak

I'd like to share a few tips that aren't covered in the documentation.
@mattrose, perhaps you could consider adding an entry to the documentation for this.


By modifying the PROMPT_COMMAND variable in your .bashrc, you can customize both the window and terminal titles.

Include the following variable definitions in your .bashrc file, and activate the desired one:

# pwd only
PROMPT_COMMAND='echo -en "\033]0; $("pwd") \a"'

## Regular
PROMPT_COMMAND='echo -en "\033]0; [ $("logname")㉿$("hostname") ] :: [ $("pwd") ] \a"'

## Fancy
PROMPT_COMMAND='echo -en "\033]0; 【 $("logname")㉿$("hostname") 】 :: 【 $("pwd") 】 \a"'

## ZEN (Clean Window Title & Title Bar)
PROMPT_COMMAND='echo -en "\033]0; \a"'

Explore various variations that appeal to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions