Commit Graph

474 Commits

Author SHA1 Message Date
Fabian Homborg
772427d788 Coolbeans theme: Pick an option color
We should do this more
2021-11-27 13:36:22 +01:00
Fabian Homborg
5a71d02d32 Webconfig: Don't outright abort if curses can't be imported
We only need the curses module to look up sgr0, bold and underline
sequences.

Since those are going to be the xterm versions 90% of the time, we can
simply use those if this fails.

Fixes #8487.
2021-11-27 09:54:08 +01:00
Ilan Cosman
30400f3ced Use test command instead of bracket command 2021-11-26 16:55:50 -08:00
Fabian Homborg
c5530421f7 themes: Add fish_color_keyword
Same as $fish_color_command for now.

This makes switching from a theme with one to a theme without nicer.
2021-11-08 19:06:01 +01:00
Fabian Homborg
8596d7e344 Themes: Add $fish_color_option
Set it to $fish_color_param for now.
2021-11-08 17:41:34 +01:00
Fabian Homborg
f724541c0a Fix setting colors via webconfig
Fixes #8419.
2021-11-08 17:38:05 +01:00
Johannes Altmanninger
a8956d955f Rename the "none" theme to "None"
Most themes use title case, as do the (change)log entries for this
theme.
2021-11-04 18:41:29 +01:00
Johannes Altmanninger
558041f6e1 None theme: Use reverse video for selected pager entry
Otherwise, with a light-theme, the selected entry uses black text with
"bright black" background, which can be low contrast thus hard to read.

The description background is different, maybe we can fix that later.

See #8376
2021-11-04 18:41:29 +01:00
Fabian Homborg
7993987b23 Use cksum in the disco prompt
It's posix, and apparently faster on slow systems. I literally can't
see a measurable difference on mine.
2021-11-03 17:52:44 +01:00
Fabian Homborg
d41b4639f7 Also turn off $fish_color_option
(technically introduced after this)
2021-11-02 21:40:56 +01:00
Fabian Homborg
78e87fe881 Add "None" theme
This basically disables syntax highlighting. That doesn't mean we use
absolutely no colors - the search match, suggestion, selection and the
pager have coloring, but only reverse or brblack.

The idea is that this disables anything that tells you about
the *syntax*, but it still tells you about the state of the
commandline. If we didn't highlight the selection it would be entirely
invisible, and if we didn't highlight the suggestion you would have no
idea where it begins.

So this basically brings colors on-par with bash, where the search
match is colored (in reverse) and suggestions aren't a thing.

An alternative is to add a $fish_highlighting_enabled variable like
the one for suggestions. That's still possible, but would require some
internal changes to avoid coloring some things with $fish_color_normal
and other things with the normal terminal color.

One thing this also does not do is set the git prompt colors. These
are currently disallowed from being set in theme files because they
start with `__fish` instead of just `fish`. We should probably rename
them.
2021-11-02 21:40:56 +01:00
Aaron Gyes
4cfe095367 update angular-route and angular-sanitize to 1.8.2 as well
URLs for source and SHAsums because the minified js is inscrutible:

https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-sanitize.min.js
https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-route.min.js

32197fa25de2415816c22fd4d512fef407e2df33  angular-route.min.js
8a6e6f02cc69e8c5bfface0d935dc6f65c9d8a05  angular-sanitize.min.js
2021-10-16 22:53:19 -07:00
Aaron Gyes
901d1f1556 fixup last commit 2021-10-16 22:44:08 -07:00
Aaron Gyes
2a0747b9f1 Update AngularJS to 1.8.2 and use Google's minified version
(it's like 170KB instead of 1.3MB)

https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js
32e24fc5f40120fe30ca097235d6c5988f84c927  angular.min.js
2021-10-16 22:41:19 -07:00
Anselm Schüler
475a2afc40
fish_prompt: clarify comment about carried-over status (#8335) 2021-10-05 21:01:13 +02:00
Fabian Homborg
aa58a54224 Webconfig: Add my own colorscheme
Already added my prompt, might a well.
2021-09-03 17:38:34 +02:00
Fabian Homborg
08690e0303 Webconfig: Use theme's name if available
The "name" here refers to the `# name:` line from the .theme file.
That's a much more descriptive name and allows using simpler filenames.
2021-09-03 17:37:54 +02:00
Fabian Homborg
4194977569 Prompt demo: Only the unmatched quote is an error
The text after is normal quoted text since
822b53c67a.

We might want to find nicer error text.

Fixes #8260.
2021-08-30 17:32:55 +02:00
Fabian Homborg
768afadcad Also read home theme directory in webconfig 2021-07-14 18:56:19 +02:00
Fabian Homborg
e021773288 Address review feedback 2021-07-11 11:23:16 +02:00
Fabian Homborg
072d735853 Webconfig: Remove colorschemes from js
This still keeps the Nord and Solarized palettes because we use the
backgrounds in the sample background list.
2021-07-09 20:36:59 +02:00
Fabian Homborg
51a55b25dc Webconfig: Read metadata from themes
This readds the preferred background and url, all read from "# url:"
and "# preferred_background:" comments in the .theme file.
2021-07-09 20:36:59 +02:00
Fabian Homborg
f301639d07 Add metadata to .theme files
Following a "#" comment. Also empty lines, so we have to deal with them.
2021-07-09 20:36:55 +02:00
Fabian Homborg
0e3d7de889 Webconfig: Read colorschemes from .theme files 2021-07-09 19:45:03 +02:00
Fabian Homborg
8091303659 Webconfig: Add colorschemes as ".theme" files
These are simple

var val [val val]

files. Basically the bit in `set -g fish_color_escape 86c1b9` after
the `set -g `. Since we're not going to `source` them, however,
arbitrary code and expansions are unsupported.

Also comments and such don't currently work.

This allows them to be easily readable both from webconfig (next
commit) and the shell (later).
2021-07-09 19:38:59 +02:00
Fabian Homborg
2aec6e5814 Webconfig: Pass colorscheme in one json request
This used to pass each color in a separate url-encoded request, which is
just wasteful.

Also it passed separate parameters for modifiers like bold and
underlined, but never gave them actual values. Instead the color is
passed as one string.

So we just use json, and then iterate over it server-side.
2021-07-09 18:26:51 +02:00
Fabian Homborg
9e46d49dd9 webconfig: Remove tab top border in dark mode 2021-06-10 21:26:03 +02:00
Fabian Homborg
e571902a85 webconfig: Hover more things
The buttons were already supposed to highlight on hover, but the color
difference was barely visible. Crank that up.

Also add a hover color to the tabs, colorschemes, prompts, functions.

The big clickable things.
2021-06-10 21:25:40 +02:00
Fabian Homborg
f6a6537f7b css: Some minor adjustments
Make borders less bright in dark version, add some padding to the body.
2021-06-10 21:00:18 +02:00
Fabian Homborg
e57c998d4c webconfig: Make a bit nicer on smaller screens
Actually remove the margins, distribute the color choices evenly and
switch to small mode a bit earlier.
2021-06-05 11:46:23 +02:00
Fabian Homborg
7a5e192607 Make background a bit more blue, brighter 2021-06-05 11:17:53 +02:00
Fabian Homborg
c2b35d3171 Adjust colors a teensy bit
Make a bit less ultra-dark blue
2021-06-05 11:17:53 +02:00
Fabian Homborg
64bbc8b304 webconfig: Dark mode 2021-06-05 11:17:53 +02:00
Fabian Homborg
5f4dfd9951 webconfig: Remove weird position: absolute
This made the current prompt appear directly under the tab,
disregarding the padding.

That means it looked inconsistent with the colors. (note there's still
less padding on the side, but at least that allows more actual content
- prompts are often fairly wide)
2021-06-03 20:55:36 +02:00
Fabian Homborg
344bd63e0b webconfig: Remove unneeded inline style
This makes changing it harder and is unnecessary
2021-06-02 17:57:48 +02:00
ridiculousfish
f25b9f9831 Make the webconfig HTTP server threaded, fixing a Safari hang
Recently Safari seems to hang with fish webconfig. This is apparently
because Safari is opening a socket and not writing to it, causing
webconfig to hang until the timeout (30 seconds). It's not clear why.

Use ThreadingMixIn so that FishConfigTCPServer can handle more
than one connection at a time. This fixes the hang under Safari.
2021-05-05 13:29:55 -07:00
Fabian Homborg
c55aa48308 Default colorscheme: Change pager prefix color for light terminals
From my checks (gnome-terminal with the "gnome light" colorscheme)
this seems to be the only color that's barely visible in a light
terminal, and it's the only color mentioned in both bug reports.

I'm leaving the artistic decisions to others, this is now *acceptable*
in both.

Note that, because we use universal variables here (hint #7317), this
will only be changed for preexisting installations when the user
reloads the colorscheme.

Fixes #3412
Fixes #3893
2021-05-01 20:16:23 +02:00
Fabian Homborg
0420901cb2 default prompt: Set fish_color_status if unset
Otherwise this'll error with --no-config
2021-05-01 18:59:25 +02:00
Fabian Homborg
e548dca686 Webconfig: Fix initial tab
For some reason the url is now

http://localhost:$PORT/$RANDOM/#!/$TAB

while this created

http://localhost:$PORT/$RANDOM/#$TAB

which redirected to

http://localhost:$PORT/$RANDOM/#!/colors#$TAB

i.e. the "colors" tab with a useless unmatched anchor.
2021-05-01 18:47:49 +02:00
Johannes Altmanninger
daa3ae4be1 fish_config: use background color for some themes search matches
See https://github.com/fish-shell/fish-shell/issues/2442#issuecomment-829636721
2021-04-30 22:13:23 +02:00
Fabian Homborg
2cea5b8eb1 Add a "prompt_login" helper function
This prints a description of the "host". Currently that's

`(chroot:debianchroot) $USER@$hostname`

with the chroot part when needed.

This also switches the default and terlar prompts to use it, the other
prompts have slightly different coloring or logic here.
2021-04-30 17:07:54 +02:00
Fabian Homborg
6aade380c1 Sample prompts: Handle print_pipestatus if TERM=dumb
This is the simple solution of just quoting it. The real solution
would probably handle `set_color` with no color better - #5443.

Fixes #7904.
2021-04-25 09:49:18 +02:00
Fabian Homborg
f21e015f1b webconfig: Make blue, green, red a bit brighter
These were hard to read in the browser, but not in the terminal.

The palette in color.cpp lists #000080 for blue, which is *even darker*. I'm not sure if that's actually a thing - I was under the impression that table was taken from xterm.

Either way, listing it in this color doesn't do anyone any favors. It's just a rough approximation anyway.
2021-04-21 17:26:52 +02:00
Fabian Homborg
152b0ef018 Webconfig: Sort the prompt list
Otherwise this has filesystem order, which on my system is quite
chaotic.

An alternative would be to randomize the order so people see different
prompts each time.
2021-04-21 17:13:03 +02:00
Fabian Homborg
f2364103b4 Sample prompts: Add a simplified version of my own prompt
Some features:

- A nice `►` prompt char with a fallback for non-utf8 systems
- The $PWD is colored depending on its sha, so different directories
  are colored differently, but each directory stays the same
- User@Host is only shown if not on the local machine (ssh or
  virtualization)
- A right prompt with a nice git display, date, duration of the last
  command (if it took over 100ms), and virtualenv
2021-04-21 17:01:05 +02:00
Fabian Homborg
4355636386 webconfig: Handle right prompt
This gets fish to print the right prompt of any sample if it has any,
and then shows it separately.

If there is a right prompt, it will also save it. If not, it will *not* overwrite an existing right prompt.
2021-04-21 17:01:05 +02:00
Fabian Homborg
84087f09d4 webconfig: Remove gigantic padding 2021-04-14 20:49:24 +02:00
Fabian Homborg
7eddf48cfa webconfig: Cleanup running prompts 2021-04-14 19:08:33 +02:00
Fabian Homborg
16d4424f6c webconfig: Only include path in error if we have one
This makes for a super misleading error message.

See #7917.
2021-04-10 11:53:36 +02:00
Fabian Homborg
4239ba133d Sample prompts: Add a "simple" prompt
This should be a simple prompt that doesn't place a huge strain on the
system but communicates the most important information simply and
effectively.

It should be a good jumping off point for making your own prompt.
2021-04-08 11:14:16 +02:00