Code Monkey home page Code Monkey logo

ttppd-tmux-auto-title's Introduction

tmux-auto-title

Utility for automatically naming windows/tabs of your tmux terminal.

The script automatically names your tmux tab using the following rules:

  • When in a git project
    • Use the name as specified in the of the origin
  • Otherwise
    • current directory name
    • current parent and directory name
    • current full path

Testing

You can test the script without making any modifications in your current $PS1 as specified in your rc file.

Start tmux/byobu and type

make

Alternatively you can just source the testing environment

source testing.sh

A testing $PS1 will be configured and you should see the title of your current tmux window change. Go and browse your filesystem.

Installing

  • Copy file tmux-titles.sh into your home folder and source it from your rc file
  • Add $(__tmux_title) somewhere in your $PS1

For example

source ~/tmux-titles.sh
export PS1='$(__tmux_title)[\u@\h]\$ '

Options

You can use the following functions from terminal in order to change the behavior of the script

  • ttdir: automatically set the title to the current directory name
  • ttparent: automatically set the title to using the two last directories in the current path.
  • ttpwd: automatically set the title to the present working directory
  • ttoff: disable automatic titles and reset current title
  • ttset: disable automatic titles and set current title to the specified first argument

Improvements

  • Option to disable git project detection
  • Option to add relative path to current git project name

ttppd-tmux-auto-title's People

Contributors

malcos avatar

Watchers

 avatar

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.