All Projects → chauncey-garrett → Zsh Prompt Garrett

chauncey-garrett / Zsh Prompt Garrett

A prompt with the information you need the moment you need it.

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Zsh Prompt Garrett

Nicy
❄️ a nice and icy zsh and bash prompt in Nim
Stars: ✭ 148 (-1.33%)
Mutual labels:  zsh, prompt
Shelby
Shelby is a fast ⚡️ , lightweight ☁️ , minimal✨, shell prompt written in Go.
Stars: ✭ 148 (-1.33%)
Mutual labels:  zsh, prompt
Liquidprompt
A full-featured & carefully designed adaptive prompt for Bash & Zsh
Stars: ✭ 4,134 (+2656%)
Mutual labels:  zsh, prompt
Lean
Pretty, minimal, one-line, fast ZSH prompt
Stars: ✭ 136 (-9.33%)
Mutual labels:  zsh, prompt
Angel Ps1
Your fancy shell prompt fed by your guardian angel
Stars: ✭ 60 (-60%)
Mutual labels:  zsh, prompt
git-prompt.zsh
A fast, customizable, pure-shell, asynchronous Git prompt for Zsh
Stars: ✭ 139 (-7.33%)
Mutual labels:  zsh, prompt
Gbt
Highly configurable prompt builder for Bash, ZSH and PowerShell written in Go.
Stars: ✭ 457 (+204.67%)
Mutual labels:  zsh, prompt
enquirer
Stylish, intuitive and user-friendly prompts, for Node.js. Used by eslint, webpack, yarn, pm2, pnpm, RedwoodJS, FactorJS, salesforce, Cypress, Google Lighthouse, Generate, tencent cloudbase, lint-staged, gluegun, hygen, hardhat, AWS Amplify, GitHub Actions Toolkit, @airbnb/nimbus, and many others! Please follow Enquirer's author: https://github.…
Stars: ✭ 6,523 (+4248.67%)
Mutual labels:  zsh, prompt
Pretty Git Prompt
`git status` inside your shell prompt
Stars: ✭ 43 (-71.33%)
Mutual labels:  zsh, prompt
Oh My Posh
A prompt theme engine for any shell.
Stars: ✭ 841 (+460.67%)
Mutual labels:  zsh, prompt
apollo-zsh-theme
Heavily customizable, compatible, and fast ZSH theme framework.
Stars: ✭ 64 (-57.33%)
Mutual labels:  zsh, prompt
Pure
Pretty, minimal and fast ZSH prompt
Stars: ✭ 10,891 (+7160.67%)
Mutual labels:  zsh, prompt
slimline
Minimal, customizable, fast and elegant ZSH prompt
Stars: ✭ 48 (-68%)
Mutual labels:  zsh, prompt
Zsh Kubectl Prompt
Display information about the kubectl current context and namespace in zsh prompt.
Stars: ✭ 342 (+128%)
Mutual labels:  zsh, prompt
bashy
Extremely fast and simple git prompt for bash and zsh
Stars: ✭ 43 (-71.33%)
Mutual labels:  zsh, prompt
Typewritten
A minimal, lightweight, informative zsh prompt theme
Stars: ✭ 442 (+194.67%)
Mutual labels:  zsh, prompt
gitprompt
Display git status in the the terminal prompt
Stars: ✭ 22 (-85.33%)
Mutual labels:  zsh, prompt
zsh-prompt-generator
Zsh Prompt Generator
Stars: ✭ 39 (-74%)
Mutual labels:  zsh, prompt
Geometry
geometry is a minimal, fully customizable and composable zsh prompt theme
Stars: ✭ 770 (+413.33%)
Mutual labels:  zsh, prompt
Mimir
Fast and minimal shell prompt
Stars: ✭ 90 (-40%)
Mutual labels:  zsh, prompt

Garrett Zsh Theme for Prezto

A prompt with the information you need the moment you need it.

NEW: It's been a long time coming but I've added gifs so you can see what the fuss is all about!

I designed my prompt for readability and to present useful information when needed.

The Garrett prompt supports:

  • git status information
  • All prompt types (PS1-PS4, Autocorrection, and a backup SUDO_PS1)
  • Notification of background jobs
  • Non-zero return codes
  • Line drawing
  • ssh status
  • Directory truncation
  • Vi-editor info
  • Job completion
  • History line number
  • The current time

Prompt types

Standard Prompt (PS1)

Many (most?) prompts put the directory information in front of the cursor entry point. Changing directories changes the location of the cursor on the screen. This inconsistent location is undesirable. The Garrett prompt cursor is consistently at the same place on the screen.

By using line drawing and inserting a newline between each command, scrolling back through your history for the output of a previous command becomes drastically easier.

Both Terminal and iTerm2 support line drawing and the prompt will look it's best there.

The Garrett prompt has a fallback if line drawing is unsupported by your terminal emulator.

The terminal theme shown here is Solarized Dark and the font is Pragmata Pro (affiliate link).

Right Prompt (RPROMPT)

The right prompt contains useful information but moves out of the way for long commands.

Continuation prompt (PS2)

Selection prompt (PS3)

NOTE: This view contains both the selection and continuation prompts. The selection prompt is shown when entering 1, 2, or 3.

Execution trace prompt (PS4)

Autocorrection prompt

Backup root prompt

There is a backup root prompt that will highlight most of the terminal in red if you switch to the sudo user inside another shell which hasn't set this prompt. It's a simple safety measure.

NOTE: This feature is available only when the shell environment is not reset by switching to the sudo command. i.e., switch to root using sudo -s and you will see the prompt change its primary color to red (as described above); switch to root with sudo -i, the environment will be reset and you'll see the base Zsh prompt instead of my custom one.

Features

This prompt has the following features. These features may be disabled and rearranged as desired by using the corresponding tokens. There are also minor changes that can (easily) be made in terms of formatting the output of the prompt by editing the prompt file itself but that's up to you.

Change host color when on ssh

You can display either the full or truncated hostname on ssh by editing the prompt file. The default is to display the truncated hostname.

NOTE: The primary prompt color changes from gray to orange—color was lost when making the gif (#1).

Change prompt color when UID is root

As a safety feature, the prompt will change color when logged in as the root user. This looks the same as host color change on ssh but with a red color instead of orange.

ls the directory contents on cd

Determine the number of background jobs

Present working directory truncation, if needed

Directory truncation will slim down the PWD to the first letter of each child directory. This is configurable via Prezto.

Report non-zero return codes

Support for non-zero return codes must be enabled. See Prezto's prompt documentation.

Report local time

You can change to time format from within the prompt file. Available options:

  • 24 hour time format (default)
  • 24 hour time format, second precise
  • AM/PM time format

Report the terminal line number

Useful for bang history completion and hipster pride.

Report git status, git remote status, git prompt info and git SHA information

Symbol Meaning
λ:master branch
9769ee9 commit hash
| dirty
ahead
behind
diverged
stashed
added
deleted
modified
renamed
unmerged
untracked

Indicate vi-mode

Normal mode:

Overwrite mode:

If you like, you can add notification of insert mode by editing the prompt.

Notifications for commands taking longer than n seconds

The default time is 2 seconds but is adjustable in the code.

Installation

  • Have a working installation of Prezto
  • Copy prompt_garrett_setup to ~/.zprezto/modules/prompt/functions/
  • Set zstyle ':prezto:module:prompt' theme 'garrett' in ~/.zpreztorc
  • Optionally, configure pwd trunctation
  • Open a new terminal window

If you'd rather not have to do this, please provide your support on Prezto #914.

Helpful tips

Here's helpful suggestions and tips for ensuring the prompt works at its best.

Like it?

If you've found this project useful, would you consider sending your support?

Author

The author of this module should be contacted via the issue tracker.

Chauncey Garrett
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].