GithubHelp home page GithubHelp logo

trystan2k / zsh-tab-title Goto Github PK

View Code? Open in Web Editor NEW
47.0 2.0 9.0 25 KB

A ZSH plugin to set the terminal tab title according to current directory or running process. It's based (forked) from Oh-My-ZSH one.

License: Other

Shell 100.00%
zsh zsh-plugin zplugin

zsh-tab-title's Introduction

ZSH Tab Title

GitHub version

Build

A zsh plugin that allows you to set a terminal header like any of PROMPT

A ZSH plugin that automatically sets terminal tab titles based on current location and task.

This is completely based on oh-my-zsh term support library.

Installation

Using zinit

Add zinit light trystan2k/zsh-tab-title into .zshrc

Using zpm

Add zpm load trystan2k/zsh-tab-title into .zshrc

Using oh-my-zsh

Execute git clone https://github.com/trystan2k/zsh-tab-title ~/.oh-my-zsh/custom/plugins/zsh-tab-title. Add zsh-tab-title into plugins array in .zshrc

Using antigen

Add antigen bundle trystan2k/zsh-tab-title into .zshrc

Using zgen

Add zgen load trystan2k/zsh-tab-title into .zshrc

Configuration

You can configure the prefix and/or suffix to be showed in tab title, besides the current folder.

DISABLE

You can disable the plugin adding

ZSH_TAB_TITLE_DISABLE_AUTO_TITLE=true

CURRENT FOLDER

You can display in the tab title, just the last folder you are in. So for example, if you are at /home/user/zsh-tab-title, the tab will only display zsh-tab-title. The default behavior, it will show the complete path, truncated at 20 chars. To enable current folder only, do:

ZSH_TAB_TITLE_ONLY_FOLDER=true

CONCAT FOLDER AND PROCESS

When executing a command, it is showed in the tab title. You can setup to concatenate the current folder to it, so it can display, for example, zsh-tab-title:ls, when doing a ls in /home/user/zsh-tab-title. To enable concat folder and process, do:

ZSH_TAB_TITLE_CONCAT_FOLDER_PROCESS=true

FULL COMMAND

Enable to show the full command being run with it's arguments in the tab title. For example, nano .zshrc will show nano .zshrc instead of just nano. Default is to display only the command without it's arguments.

ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true

PREFIX

The prefix can be configured using the variable ZSH_TAB_TITLE_PREFIX and it will be added before the current folder, in tab title. For example:

ZSH_TAB_TITLE_PREFIX='$USER@$HOST - '

By default, if no value is informed, it is used the value %m@%n: which will show the user name and computer name, separated by @. For example: trystan2k@MyPC: /home/trystan2k. This default value can be disabled if variable ZSH_TAB_TITLE_DEFAULT_DISABLE_PREFIX is set to true. For example:

ZSH_TAB_TITLE_DEFAULT_DISABLE_PREFIX=true

SUFFIX

The suffix can be configured using the variable ZSH_TAB_TITLE_SUFFIX and it will be added after the current folder, in tab title. For example:

ZSH_TAB_TITLE_SUFFIX='- $USER'

This variable has no default value, so if nothing is informed, no suffix is added

ADDITIONAL TERMS

By default the tab title is set for iTerm, Hyper, and where $TERM is set to one of cygwin,xterm*,putty*,rxvt*,ansi,screen*,tmux* Additional $TERMS to set the tab title for can be configured with the variable ZSH_TAB_TITLE_ADDITIONAL_TERMS. For example:

ZSH_TAB_TITLE_ADDITIONAL_TERMS='alacritty|kitty|foot'

This variable has no default value, so if nothing is informed, no suffix is added

zsh-tab-title's People

Contributors

arcnmx avatar forgottenumbrella avatar ibrokemypie avatar smhmd avatar szilard-nemeth avatar trystan2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zsh-tab-title's Issues

Tab title not updating

The tab title is not updating when I change the directory. For it to update I had to run source ~/.zshrc to update the tab title.

2022-07-05 12 44 32

zsh-tab-title plugin not found

I am using zsh and oh-my-zsh.
Following your installation guide leads to an error with oh-my-zsh.

Execute git clone https://github.com/trystan2k/zsh-tab-title ~/.oh-my-zsh/custom/plugins/zsh-tab-title. Add zsh-tab-title into plugins array in .zshrc

The error is: [oh-my-zsh] plugin 'zsh-tab-title' not found

I corrected the issue by renaming title.plugin.zsh to zsh-tab-title.plugin.zsh and then it works as expected.

Disable prefix not working

Hi.

I have set the ZSH_TAB_TITLE_DEFAULT_DISABLE_PREFIX=true in my .zshrc but the user and computer name separated by '@' is still showing in the title.

Using v.2.2.0

Allow user specified TERM support

Currently this plugin only works when the terminals TERM variable is one of a small list. It would be great to have an extra variable to pass a list of additional accepted TERM values, eg foot,alacritty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.