{"id":13462039,"url":"https://github.com/barraq/sexy-bash-prompt","last_synced_at":"2025-03-25T01:31:37.688Z","repository":{"id":12621877,"uuid":"15293098","full_name":"barraq/sexy-bash-prompt","owner":"barraq","description":"Bash prompt with colors, git statuses, and git branches.","archived":false,"fork":true,"pushed_at":"2013-12-29T14:02:53.000Z","size":419,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T12:07:32.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"twolfson/sexy-bash-prompt","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barraq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-18T20:09:37.000Z","updated_at":"2013-12-29T14:02:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/barraq/sexy-bash-prompt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barraq%2Fsexy-bash-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barraq%2Fsexy-bash-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barraq%2Fsexy-bash-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barraq%2Fsexy-bash-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barraq","download_url":"https://codeload.github.com/barraq/sexy-bash-prompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222031147,"owners_count":16919368,"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-07-31T12:00:37.665Z","updated_at":"2024-10-29T10:30:34.755Z","avatar_url":"https://github.com/barraq.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# sexy-bash-prompt [![Build status](https://travis-ci.org/twolfson/sexy-bash-prompt.png?branch=master)](https://travis-ci.org/twolfson/sexy-bash-prompt)\n\n[Bash][bash] prompt with colors, git statuses, and git branches.\n\nProviding a unique symbol for every combination of a dirty, unpulled, and unpushed `git` branch.\n\n![sexy-bash-prompt screenshot][screenshot]\n\n[screenshot]: screenshot.png\n\nForked from [a gist by gf3][sexy-bash-orig].\n\n[sexy-bash-orig]: https://gist.github.com/gf3/306785/a35d28b6bdd0f7c54318cce510738438f04dabaa\n\n## Installation\nOne line install:\n\n```bash\n(cd /tmp \u0026\u0026 git clone --depth 1 https://github.com/twolfson/sexy-bash-prompt \u0026\u0026 cd sexy-bash-prompt \u0026\u0026 make install) \u0026\u0026 source ~/.bashrc\n```\n\n### My colors don't look as advertised\nIf you are seeing a screen like this:\n\n![Bad TERM config](docs/bad_term.png)\n\nThen, your `TERM` environment variable may never have been configured. Run the script below to prefix our prompt with a `TERM` setup\n\n```bash\ncat \u003e /tmp/.bash_prompt_term \u003c\u003cEOF\n#!/usr/bin/env bash\n# Determine what type of terminal we are using for \\`tput\\`\nif [[ \\$COLORTERM = gnome-* \u0026\u0026 \\$TERM = xterm ]]  \u0026\u0026 infocmp gnome-256color \u003e/dev/null 2\u003e\u00261; then export TERM=gnome-256color\nelif [[ \\$TERM != dumb ]] \u0026\u0026 infocmp xterm-256color \u003e/dev/null 2\u003e\u00261; then export TERM=xterm-256color\nfi\n\nEOF\nchmod +x /tmp/.bash_prompt_term\ncat ~/.bash_prompt \u003e\u003e /tmp/.bash_prompt_term\ncp /tmp/.bash_prompt_term ~/.bash_prompt\nrm /tmp/.bash_prompt_term\n```\n\n### Manual install\n```bash\n$ # Clone the repository\n$ git clone --depth 1 https://github.com/twolfson/sexy-bash-prompt\nCloning into 'sexy-bash-prompt'...\n...\nResolving deltas: 100% (13/13), done.\n$ # Go into the directory\n$ cd sexy-bash-prompt\n$ # Install the script\n$ make install\n# Copying .bash_prompt to ~/.bash_prompt\ncp --force .bash_prompt ~/.bash_prompt\n# Adding ~/.bash_prompt to ~/.bashrc\necho \". ~/.bash_prompt\" \u003e\u003e ~/.bashrc\n# twolfson/sexy-bash-prompt installation complete!\n$ # Rerun your ~/.bashrc\n$ source ~/.bashrc\ntodd at Euclid in ~/github/sexy-bash-prompt on master\n$ # Your PS1 should now look like this!\n```\n\n## Configuration\nThe styles can be customized by editing `.bash_prompt` directly, or by setting the following environment variables:\n\n- `PROMPT_USER_COLOR` - Color for username (e.g. `todd`)\n- `PROMPT_PREPOSITION_COLOR` - Color for 'at', 'in', 'on'\n- `PROMPT_DEVICE_COLOR` - Color for machine name (e.g. `Euclid`)\n- `PROMPT_DIR_COLOR` - Color for directory (e.g. `~/github/sexy-bash-prompt`)\n- `PROMPT_GIT_STATUS_COLOR` - Color for git branch and symbol (e.g. `master`)\n- `PROMPT_SYMBOL_COLOR` - Color for prompt symbol (e.g. `$`)\n\nYou can set colors via [`tput`][] or [ANSI escape codes][]. For example:\n\n[`tput`]: http://en.wikipedia.org/wiki/Tput\n[ANSI escape codes]: http://en.wikipedia.org/wiki/ANSI_escape_code\n\n```bash\n# Inside your `.bashrc` or `.bash_profile`\nPROMPT_USER_COLOR=\"$(tput bold)$(tput setaf 9)\" # BOLD RED\nsource ~/.bash_prompt\n```\n\n![Color overridden prompt](docs/color_override.png)\n\n## How does it work?\n[bash][bash] provides a special set of [variables for your prompts][ps-vars]. `PS1` is the one used by default. The install script adds a command to `~/.bashrc`, a file that is run every time a new terminal opens. Inside of the new command, we run our script and set your `PS1` which runs some `git` commands to determine its current state and outputs them as a string.\n\n[bash]: https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29\n[ps-vars]: http://www.gnu.org/software/bash/manual/bashref.html#index-PS1\n\n## Donating\nSupport this project and [others by twolfson][gittip] via [gittip][].\n\n[![Support via Gittip][gittip-badge]][gittip]\n\n[gittip-badge]: https://rawgithub.com/twolfson/gittip-badge/master/dist/gittip.png\n[gittip]: https://www.gittip.com/twolfson/\n\n## Support\nLinux and Mac OSX are supported platforms.\n\nWindows is supported to the best of my abilities. However, there have been [font issues][putty-issue] with using [PuTTY][].\n\n[PuTTY]: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html\n[putty-issue]: https://github.com/twolfson/sexy-bash-prompt/issues/7\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via `make test`.\n\n## License\nCopyright (c) 2013 Todd Wolfson\n\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarraq%2Fsexy-bash-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarraq%2Fsexy-bash-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarraq%2Fsexy-bash-prompt/lists"}