From 14c4ce1974e31cb51c5e233de1242de5d4a238ca Mon Sep 17 00:00:00 2001 From: Muhammad Mejanul Haque <41269045+MejanH@users.noreply.github.com> Date: Thu, 2 Jul 2020 06:46:40 +0600 Subject: [PATCH] docs: show current directory in terminal window title (#1415) --- docs/advanced-config/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/advanced-config/README.md b/docs/advanced-config/README.md index a5a2dda3..21ae60a2 100644 --- a/docs/advanced-config/README.md +++ b/docs/advanced-config/README.md @@ -73,7 +73,17 @@ precmd_functions+=(set_win_title) ``` If you like the result, add these lines to your shell configuration file -(`~/.bashrc` or `~/.zsrhc`) to make it permanent. +(`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, +add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Style Strings