Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🌵 Very quick shell prompt that supports multiple shells.

License

NotificationsYou must be signed in to change notification settings

willeccles/promptus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple and configurable shell prompt program in C which can be used to make yourprompt the same on any shell.

preview of promptus

Features

Promptus is very simple, but has some convenience features for those who wantthem:

  • Display of the PWD (enabled by default)
  • Basename of PWD (enabled by default)
  • Abbreviation of$HOME to~ (enabled by default)
  • Coloring of prompt based on exit code of previous program (enabled by default)
  • Customizable color set
  • Python venv prefix support

Configuration

See config.h for configuration options.

Building

Modify config.h to suit your needs and then domake. Usemake install toinstall andmake uninstall to uninstall.

Usage

Simply running promptus is enough. IfPROMPT_STATUS is enabled in config.h,pass the exit code of the previous process as the first argument (or don't,which allows you to disable this feature at runtime without rebuildingpromptus).

Bash

If you are using bash and want to use promptus for your prompt, this is howI would do it. Put this in your .bashrc:

export PROMPT_COMMAND=__prompt_commandifcommand -v promptus>/dev/null;then__prompt_command() { PS1="$(promptus$?)" }else__prompt_command() {# if you have a default prompt you'd like to use when promptus isn't# installed, you should set PS1 here    }fi

Zsh

If you are using zsh, things are a little weirder than bash, but work about thesame way. Try this:

ifcommand -v promptus>/dev/null;thenprecmd() { PROMPT="$(eval'promptus $?')" }fi# this won't get used if promptus is found aboveexport PROMPT="my cool prompt $"

About

🌵 Very quick shell prompt that supports multiple shells.

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp