Skip to content

Commit

Permalink
Fixed 256/true color mode config
Browse files Browse the repository at this point in the history
  • Loading branch information
noccy80 committed Dec 18, 2016
1 parent 86d5fe0 commit e3cdc4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@ You can reload your theme by switching to it again using `phpl-config`, or by ca
$ phpl-config --theme mytheme
$ phpl-reload --theme

### Tweaks and fixes

Note: You need to call `phpl-reload` manually after changing this setting.

**UTF-8 icons on physical terminal**

PHPL will detect when it is running on an actual tty, to disable unicode icons as these
rarely comes out as expected. If your tty supports UTF-8, or your terminal is mistaken
for a tty you can override this behavior:

$ phpl-config -cterm.forceutf8=true

**Enabling 256-color/truecolor mode**

To enable 256-color mode, use the following:

$ phpl-config -cterm.colormode=1

Setting it to `0` will revert back to 16-color mode. For truecolor, instead use `2`.

### Integrating

To use the prompt in other ansi-capable scenarios, you can call on `phpl-generate`.
Expand All @@ -146,6 +166,4 @@ use `-n`.

Things that need improving:

* Better handling of 256-color and 24b-color stuff. Pragmas are in place but not active.
* Need to strip UTF-8 when outputting to a physical console as most icons fail there.
* Solarized theme need dark and light variants.
6 changes: 3 additions & 3 deletions bin/phpl-config
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function print_help() {
printf(" -l,--list List enabled modules\n");
printf(" -L,--list-modules List available modules and options\n");
printf(" -E Open configuration file in text editor\n");
printf(" --theme <name> Change the color theme\n");
printf(" --theme <name> Change the color theme (use --theme list for theme list)\n");
printf(" -h,--help Show this help\n");
printf(" -c,--config Set a global configuration option\n");
printf(" -c,--config Set a global configuration option (use --config list to list options)\n");
printf("\n");
printf("Options: -b,--before <name> Insert before specified item\n");
printf(" -a,--after <name> Insert after specified item\n");
Expand Down Expand Up @@ -68,8 +68,8 @@ if (!file_exists(PHPL_CONFIG)) {
}
*/

config_read();
scan_modules();
config_read();

if (cmdl_get($opts,'list')) {
$items = config_item_list();
Expand Down

0 comments on commit e3cdc4b

Please sign in to comment.