{"id":33014482,"url":"https://github.com/philFernandez/printc","last_synced_at":"2025-11-19T09:01:25.985Z","repository":{"id":56592854,"uuid":"230343456","full_name":"philFernandez/printc","owner":"philFernandez","description":"zsh plugin for wrapping ANSI color codes","archived":false,"fork":false,"pushed_at":"2020-10-29T19:03:01.000Z","size":21,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-17T00:18:48.258Z","etag":null,"topics":["ansi-colors","oh-my-zsh","shell","zplug","zsh","zsh-plugin","zsh-plugins"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/philFernandez.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}},"created_at":"2019-12-26T23:59:54.000Z","updated_at":"2023-07-13T09:23:26.000Z","dependencies_parsed_at":"2022-08-15T21:31:28.257Z","dependency_job_id":null,"html_url":"https://github.com/philFernandez/printc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philFernandez/printc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philFernandez%2Fprintc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philFernandez%2Fprintc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philFernandez%2Fprintc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philFernandez%2Fprintc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philFernandez","download_url":"https://codeload.github.com/philFernandez/printc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philFernandez%2Fprintc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285215532,"owners_count":27133906,"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","status":"online","status_checked_at":"2025-11-19T02:00:05.673Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ansi-colors","oh-my-zsh","shell","zplug","zsh","zsh-plugin","zsh-plugins"],"created_at":"2025-11-13T18:00:20.530Z","updated_at":"2025-11-19T09:01:25.972Z","avatar_url":"https://github.com/philFernandez.png","language":"Shell","readme":"# printc\n\nWith this plugin you can print any color within the rgb color space via an interface that\nis as simple as a regular print statement.\n\nThis simple tool provides an abstraction layer on top of terminal ANSI rgb escape codes,\nmaking the addition of colorized output to your functions, shell scripts, and/or\ninteractive terminal in zsh a piece of cake. There is support for any of the colors which\ncan be achieved via the form R G B, where R, G and B are any numeric value\nbetween 0 and 255, representing the red, green, blue color space values respectively.\nUsers of this plugin are able to issue a  `printc` statement, followed by the previous\nmentioned rgb values, followed by the text to be printed. There is also 36 built in colors\nwhich can be accessed via tab auto-complete. And there is support for bold, italic,\nblinking, and underline text.\n\n![screenshot](https://imgur.com/K0FVGzr.png)\n\n\n#### Table of Contents\n - [Setup](#Setup)\n - [Configuration](#Configuration)\n    - [Requirements](#Requirements)\n    - [Italics Setup](#Italics-Setup)\n - [Usage](#Usage)\n    - [Options](#Options)\n    - [General Structure of Command](#General-Structure-of-Command)\n\n\n## Setup\n`git clone https://github.com/philFernandez/printc-.git`\n\nPut the `printc` file in a location that is in your $PATH. Perhaps `~/bin` or `~/.bin`\nor any other directory which you have access to, and is in your $PATH. There is an\nautocomplete function included called `_printc`. Put that file in any location\nwhich is under your $fpath. You may need to delete the ~/.zcompdump file, and reload\nzsh. This will re-build the ~/.zcompdump file, and should pick up the new completion\nfunction as long as it is stored in a directory that is in the $fpath. The autocomplete\nis nice because it lets you tab through all of the built in colors included\nwith this plugin.\n\n## Configuration\n\n### Requirements\nYour terminal emulator must support 256 color. If you want to leverage italic text,\ndepending on your terminal emulator you will likely need to add support for displaying\nitalic text. The process is very simple, and I'll include instruction on how to do so. As\nlong as your terminal emulator supports, and is set up for 256 color, which almost all are\nnow-a-days, you can use the color aspect of the plugin, even without the italic\nfunctionality.\n\nAt the least your TERM environment variable must be set as so:\n```\nexport TERM=xterm-256color\n```\n\nIt is possible that this is all that will be needed for the italic functionality to work\nas well. I do recommend trying and seeing if italics work. It it does not, just follow the\nsimple steps below.\n\n### Italics Setup\n\n---\n##### An Aside on Italics\n * It is likely that the italics as implemented in the `printc` plugin\n   will work without needing the setup described below.\n * This section is here as reference for people who *do* have problems getting\n   italics to work in the terminal.\n * This method of enabling italics may cause problems.\n * The most common problems arise for those who ssh into remote machines.\n * If you do use this method, and end up with ssh problems, because the terminal\n   reports a TERM value that the server doesn't understand, it can probably be remedied as\n   follows...\n\n\n Logging into a remote server with something like `ssh user@remote.host`\n\n Can be changed to `TERM=xterm-256color ssh user@remote.host`\n\n Prepending `TERM=xterm-256color` just before your normal ssh command will pass along a\n TERM value that the server understands, without impacting your local TERM value. This can\n be aliased for convenience.\n\n---\n\n 1) Create a directory `~/.terminfo`\n\n 2) Create a file inside `~/.terminfo` called `xterm-256color-italics.terminfo`\n\n 3) Place the following contents inside `xterm-256color-italics.terminfo` *exactly* as\n they are shown:\n\n ```\n xterm-256color-italic|xterm with 256 colors and italic,\n sitm=\\E[3m, ritm=\\E[23m,\n use=xterm-256color,\n ```\n\n 4) Inside `~/.terminfo` run the command `tic xterm-256color-italics.terminfo`\n\n 5) Set your TERM environment variable as so:\n ```\n export TERM=xterm-256color-italic\n ```\n You can export TERM in your `~/.zshrc` or `~/.zshenv` or many other ways. If you're an\n iTerm2 user you can do it through the GUI terminal emulator settings there. It doesn't\n matter how you do it, as long as the TERM environment variable is set and exported to\n one of the above mentioned values, either `xterm-256color` or `xterm-256color-italic`.\n Again, I recommend trying things out with `xterm-256color` and seeing if they work for\n you *before* following the italics setup.\n\n\n As an aside, I have not tested this inside TMUX, but it should work there as long as the\n environment is set up to properly handle color and italics.\n\n### Blinking Text\n\nMany terminals have no support for blinking text. This may be considered a feature of\nthose terminals rather than a bug.\n\n# Usage\n\n### Options\n  | Option              | Function                    |\n  | :-----------------: | --------------              |\n  | -b                  | Bold                        |\n  | -u                  | Underline                   |\n  | -i                  | Italic                      |\n  | -k                  | Blink                       |\n  | -C `color`          | Specify built in color      |\n  | -l                  | List built in colors        |\n  | -n                  | No newline                  |\n  | -r                  | No ending ANSI code         |\n  | -R                  | Print only ending ANSI code |\n  | -h                  | Display help page           |\n\n### General Structure of Command\n * `printc [-b] [-u] [-i] [-n] [-r] \u003c0-255\u003e \u003c0-255\u003e \u003c0-255\u003e \"Colorized Text to Display\"`\n     * This is the structure used when specifying a color with RGB values.\n     * Note the absense of quotes around the RGB numbers, this is required.\n     * Note the inclusion of quotes around the intended output, also required.\n         * As usual double quotes will allow parameter expansion.\n     * The RGB values must come after any options, and before the intended output.\n * `printc [-b] [-u] [-i] [-k] [-n] [-r] -C \u003cbuilt in color\u003e \"Colorized Text to Display\"`\n     * This is the structure used when specifying a color that is built in to the plugin.\n     * Quoting the intended output is not required when using built in color options.\n * `printc -R`\n     * For use with an earlier `printc -r -C \u003ccolor\u003e \"text\"`, for use in prompts and other places where the color code and the ending code may need to be separate.\n * Options can be given in any order, and chained together, such as\n `-buinC \u003cbuilt in color\u003e`, so long as `built in color` follows immediately after `-C`,\n   and in the case of using RGB values, they must come after any options that are given.\n\n","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FphilFernandez%2Fprintc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FphilFernandez%2Fprintc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FphilFernandez%2Fprintc/lists"}