{"id":16027460,"url":"https://github.com/theacodes/powerline-shell","last_synced_at":"2026-06-06T17:30:18.828Z","repository":{"id":66132258,"uuid":"80249012","full_name":"theacodes/powerline-shell","owner":"theacodes","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-06T17:15:41.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T09:42:39.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theacodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-27T21:48:24.000Z","updated_at":"2018-11-06T17:15:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"7885c5eb-33fa-41a2-a695-96c2a79692a0","html_url":"https://github.com/theacodes/powerline-shell","commit_stats":{"total_commits":192,"total_committers":53,"mean_commits":"3.6226415094339623","dds":0.671875,"last_synced_commit":"e9ad780a37b25e2fd5c723b06978553e502bff85"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fpowerline-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fpowerline-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fpowerline-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fpowerline-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theacodes","download_url":"https://codeload.github.com/theacodes/powerline-shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240190770,"owners_count":19762583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T20:21:44.335Z","updated_at":"2026-06-06T17:30:18.749Z","avatar_url":"https://github.com/theacodes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"A Powerline style prompt for your shell\n=======================================\n\nA [Powerline](https://github.com/Lokaltog/vim-powerline) like prompt for Bash, ZSH and Fish:\n\n![MacVim+Solarized+Powerline+CtrlP](https://raw.github.com/milkbikis/dotfiles-mac/master/bash-powerline-screenshot.png)\n\n*  Shows some important details about the git/svn/hg/fossil branch:\n    *  Displays the current branch which changes background color when the branch is dirty\n    *  A '+' appears when untracked files are present\n    *  When the local branch differs from the remote, the difference in number of commits is shown along with '⇡' or '⇣' indicating whether a git push or pull is pending\n*  Changes color if the last command exited with a failure code\n*  If you're too deep into a directory tree, shortens the displayed path with an ellipsis\n*  Shows the current Python [virtualenv](http://www.virtualenv.org/) environment\n*  It's easy to customize and extend. See below for details.\n\n# Setup\n\nThis script uses ANSI color codes to display colors in a terminal. These are\nnotoriously non-portable, so may not work for you out of the box, but try\nsetting your $TERM to `xterm-256color`, because that works for me.\n\n* Patch the font you use for your terminal: see https://github.com/Lokaltog/powerline-fonts\n\n  * If you struggle too much to get working fonts in your terminal, you can use \"compatible\" mode.\n  * If you're using old patched fonts, you have to use the older symbols. Basically reverse [this commit](https://github.com/milkbikis/powerline-shell/commit/2a84ecc) in your copy\n\n* Clone this repository somewhere:\n\n        git clone https://github.com/milkbikis/powerline-shell\n\n* Copy `config.py.dist` to `config.py` and edit it to configure the segments you want. Then run\n\n        ./install.py\n\n  * This will generate `powerline-shell.py`\n\n* (optional) Create a symlink to this python script in your home:\n\n        ln -s \u003cpath/to/powerline-shell.py\u003e ~/powerline-shell.py\n\n  * If you don't want the symlink, just modify the path in the commands below\n\n* For python2.6 you have to install argparse\n\n        pip install argparse\n\n### All Shells:\nThere are a few optional arguments which can be seen by running `powerline-shell.py --help`.\n\n```\n  --cwd-mode {fancy,plain,dironly}\n                        How to display the current directory\n  --cwd-max-depth CWD_MAX_DEPTH\n                        Maximum number of directories to show in path\n  --cwd-max-dir-size CWD_MAX_DIR_SIZE\n                        Maximum number of letters displayed for each directory\n                        in the path\n  --colorize-hostname   Colorize the hostname based on a hash of itself.\n  --mode {patched,compatible,flat}\n                        The characters used to make separators between\n                        segments\n```\n\n### Bash:\nAdd the following to your `.bashrc` (or `.profile` on Mac):\n\n        function _update_ps1() {\n           PS1=\"$(~/powerline-shell.py $? 2\u003e /dev/null)\"\n        }\n\n        if [ \"$TERM\" != \"linux\" ]; then\n            PROMPT_COMMAND=\"_update_ps1; $PROMPT_COMMAND\"\n        fi\n\n### ZSH:\nAdd the following to your `.zshrc`:\n\n        function powerline_precmd() {\n          PS1=\"$(~/powerline-shell.py $? --shell zsh 2\u003e /dev/null)\"\n        }\n\n        function install_powerline_precmd() {\n          for s in \"${precmd_functions[@]}\"; do\n            if [ \"$s\" = \"powerline_precmd\" ]; then\n              return\n            fi\n          done\n          precmd_functions+=(powerline_precmd)\n        }\n\n        if [ \"$TERM\" != \"linux\" ]; then\n            install_powerline_precmd\n        fi\n\n### Fish:\nRedefine `fish_prompt` in ~/.config/fish/config.fish:\n\n        function fish_prompt\n            ~/powerline-shell.py $status --shell bare ^/dev/null\n        end\n\n# Customization\n\n### Adding, Removing and Re-arranging segments\n\nThe `config.py` file defines which segments are drawn and in which order. Simply\ncomment out and rearrange segment names to get your desired arrangement. Every\ntime you change `config.py`, run `install.py`, which will generate a new\n`powerline-shell.py` customized to your configuration. You should see the new\nprompt immediately.\n\n### Contributing new types of segments\n\nThe `segments` directory contains python scripts which are injected as is into\na single file `powerline_shell_base.py`. Each segment script defines a function\nthat inserts one or more segments into the prompt. If you want to add a new\nsegment, simply create a new file in the segments directory and add its name to\nthe `config.py` file at the appropriate location.\n\nMake sure that your script does not introduce new globals which might conflict\nwith other scripts. Your script should fail silently and run quickly in any\nscenario.\n\nMake sure you introduce new default colors in `themes/default.py` for every new\nsegment you create. Test your segment with this theme first.\n\n### Themes\n\nThe `themes` directory stores themes for your prompt, which are basically color\nvalues used by segments. The `default.py` defines a default theme which can be\nused standalone, and every other theme falls back to it if they miss colors for\nany segments. Create new themes by copying any other existing theme and\nchanging the values. To use a theme, set the `THEME` variable in `config.py` to\nthe name of your theme.\n\nA script for testing color combinations is provided at `themes/colortest.py`.\nNote that the colors you see may vary depending on your terminal. When designing\na theme, please test your theme on multiple terminals, especially with default\nsettings.\n\n# Changes\n\n2015-10-02\n\n* New option (`--cwd-max-dir-size`) which allows you to limit each directory\n  that is displayed to a number of characters. This currently does not apply\n  if you are using `--cwd-mode plain`.\n  ([@mart-e](https://github.com/milkbikis/powerline-shell/pull/127))\n\n2015-08-26\n\n* New `plain` mode of displaying the current working directory which can be\n  used by adding `--cwd-only plain` to `powerline-shell.py`.\n  This deprecates the `--cwd-only` option. `--cwd-mode dironly` can be used\n  instead. ([@paol](https://github.com/milkbikis/powerline-shell/pull/156))\n\n2015-08-18\n\n* New `time` segment\n  ([@filipebarros](https://github.com/milkbikis/powerline-shell/pull/107))\n\n2015-08-01\n\n* Use `print` function for some python3 compatibility\n  ([@strycore](https://github.com/milkbikis/powerline-shell/pull/195))\n\n2015-07-31\n\n* The current working directory no longer follows symbolic links\n* New `exit_code` segment\n  ([@disruptek](https://github.com/milkbikis/powerline-shell/pull/129))\n\n2015-07-30\n\n* Fix ZSH root indicator\n  ([@nkcfan](https://github.com/milkbikis/powerline-shell/pull/150))\n* Add uptime segment\n  ([@marcioAlmada](https://github.com/milkbikis/powerline-shell/pull/139))\n\n2015-07-27\n\n* Use `python2` instead of `python` in hashbangs\n  ([@Undeterminant](https://github.com/milkbikis/powerline-shell/pull/100))\n* Add `node_version` segment\n  ([@mmilleruva](https://github.com/milkbikis/powerline-shell/pull/189))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheacodes%2Fpowerline-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheacodes%2Fpowerline-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheacodes%2Fpowerline-shell/lists"}