Commit Graph

563 Commits

Author SHA1 Message Date
Aaron Gyes
b83d8dc8c0 angular: remove sourceMappingURL comments
We don't ship source maps, so just remove these
comments to prevent the annoying 404s the server
will print out when using `fish_config`.
2022-03-26 17:14:09 -07:00
Fabian Homborg
62807c2788 fish_config: Let tabs wrap
Otherwise they would scroll off-screen for narrow windows. This was intentional.
2022-03-26 22:54:17 +01:00
Aaron Gyes
be4fa1dc1a fish_config: improve tab display
Use a heavier weight slightly larger font, remove the borders, and
prevent wrapping like:

    Binding
       s
2022-03-26 14:46:46 -07:00
Fabian Homborg
25e02ea07f fish_config: Use the same body fonts as the doc theme
Otherwise this was 100% monospace.

But since we have a specific list of fonts that we have checked, let's
use the same list instead of just adding "Helvetica" again.
2022-03-26 21:57:11 +01:00
Fabian Homborg
ff6a12e9c6 Revert "fish_config: use system-ui/sans serif for non-shell/code text"
Like the comment says: List explained in pydoctheme.css.

This also removed a number of other fonts.

This reverts commit f3cf32a085.
2022-03-26 21:53:23 +01:00
Aaron Gyes
f3cf32a085 fish_config: use system-ui/sans serif for non-shell/code text
This is nicer. It was actually using monospace fonts across
the board before.

Tweak tab rendering.
2022-03-26 13:48:23 -07:00
Aaron Gyes
776fc0b7f3 fish_config: HTML5 doctype 2022-03-26 13:27:22 -07:00
Aaron Gyes
492f9bb046 web config: buttons are <buttons> instead of <span>s.
This is exactly what <button> is for, and we can remove
some CSS.
2022-03-26 13:27:22 -07:00
Fabian Homborg
edbd3baa59 fish_config: Set colors that aren't set in the theme to empty
This allows keeping it to the fallback value, making us independent
from the theme that was set before.
2022-03-20 17:04:28 +01:00
Matti Viljanen
5994e44877 Fix launching fish_config on SailfishOS 2022-03-18 15:56:22 +01:00
Radu Potop
2884b27367
Astronaut prompt theme (#8775)
* Added initial commit for the Starfish prompt theme

* Respect cwd colors

* Corrected typo

* Renamed theme to Astronaut

* Fixed cwd_color for root

* Allow longer dir names, fix variable setting
2022-03-15 17:06:00 +01:00
Fabian Homborg
68f099d804 Webconfig: Go to small-screen mode earlier
Since the color previews are now wider, we had quite a wide range
where there would only be one. Remove the border around the content
earlier so windows with 1000px width still get two previews in a row.

(making the text shorter would also be an option here)
2022-02-25 18:27:17 +01:00
Fabian Homborg
0614f507ff Webconfig: Make colorscheme samples nicer to read
This makes the container fit the content, otherwise we'd be cutting
off the "> quack &" part of the first line.

Also while we're here increase the line-height a bit to give it more
breathing room, and increase the font size juuust a smidge.

Reduce margins and increase padding to make it less cramped.
2022-02-25 18:18:43 +01:00
Fabian Homborg
d0667e9e88
disco prompt: Use $hostname 2022-02-16 15:07:06 +01:00
Fabian Homborg
84e7fbd466 Make default .theme file consistent with uvars
This takes the changes from 03b23dd1b6
and applies them to the .theme version as well.

(note: It's *possible* to just go through fish_config in future, but
we do not want to do that right now because that can have issues on
upgrade)
2022-02-03 13:09:52 +01:00
Fabian Homborg
9d59254a72 themes: Resolve pager_selected_background
This sets the variable to the background value of
$fish_color_search_match, which fixes the case where you switch from a
theme with a set selected background (like our default, now) to one without.
2022-01-19 17:54:59 +01:00
Fabian Homborg
24f9fdd0a7 themes/default: Set pager selection to reverse
This makes it look okay on both light and dark backgrounds.
2022-01-19 17:23:42 +01:00
Fabian Homborg
30dc91225e css: Pick nicer fonts
Unfortunately the normal font families like "sans-serif" and
"monospace" are basically broken because the browser defaults are
decades old.

TODO: Inline code is barely distinguishable.
2022-01-13 16:23:54 +01:00
Fabian Homborg
cc796e4dfc Webconfig: Remove unused font declaration
This was for <code> tags, which we don't have here. The rest is
already all monospace and Source Code Pro has bugs on macOS.
2022-01-13 16:23:54 +01:00
Fabian Homborg
41da16408a sample_prompts/disco: Actually use luminance for dir color
Instead of weirdly smearing the color, simply increase the values
until they are bright enough.

This prevents /tmp from being white, and guarantees visible colors for
all directories.
2022-01-05 18:14:24 +01:00
Ilya Grigoriev
084967e560 webconfig.py: minor polish of is_chromeos_garcon
The `name` attribute I used in commit f725cd402d
is undocumented, and [someone discovered] that it does not exist for one 
possible browser on MacOS. This should make the code work correctly even in that case. 

This probably doesn't currently cause a problem, at least when 
`isMacOS10_12_5_OrLater()` is true, because of the ordering of the if 
statements in the `runThing` function.

[someone discovered]: https://bugs.python.org/issue43424#msg409087
2021-12-30 12:55:52 +01:00
Aaron Gyes
6c6a8f93e9 webconfig.py: don't handle except BaseException
These ought to be more specific.
2021-12-21 14:06:19 -08:00
Aaron Gyes
50d88e9712 controllers.js: remove unused variable cols[]
introduced in ba0b7133ad
2021-12-21 13:59:33 -08:00
Fabian Homborg
67dc86cfa4 webconfig: Skip colors not named in a theme
This is a stop gap. Ideally setting a theme would be idempotent. You
set it, all colors change to match it, even the ones it does not
specify.

However, I do not believe we can *erase* colors that aren't set, and
we don't currently do so in the CLI version. So skip setting these at
all, for now.

If a color is mentioned but empty, it will be set to empty.
2021-12-14 22:54:28 +01:00
Fabian Homborg
3daba1b070 webconfig: Stop translating named colors
If the theme says "brgreen", that's what we want the variable to say
after.

This used to translate it through our palette, so it ended up as
00ff00, which isn't the same.

This still keeps the idea that colors that aren't in the palette are
better, and it does it in a slightly roundabout way (translate color
string to rgb string, see if the rgb string is a key in that
translation dictionary), but it should work for now.
2021-12-14 22:51:54 +01:00
Fabian Homborg
06fada7445 webconfig: Check variable name and value
Theoretically if this only includes simple characters, it won't cause
any issues. We already validate in other places but it doesn't hurt to
do this twice.
2021-12-13 21:59:08 +01:00
Fabian Homborg
c954d70e2f webconfig: Stop validating colors
Now that we have modifiers and can have backgrounds and such, simply
setting it as css style doesn't cut it.

So let's stop validating for now, the worst that can happen is that
the color isn't rendered.
2021-12-13 21:47:54 +01:00
Fabian Homborg
5a46a61ffb webconfig: Teach set_color short options
Since we now have .theme files we can't rely on it being normalized.
2021-12-13 21:47:54 +01:00
Fabian Homborg
ba0b7133ad webconfig: Allow transferring modifiers and backgrounds
This just simply passed the "color" value, which is just the
foreground color string.

Instead, we pass the actual object back, with the modifiers as bools
and foreground/background separate.

Our themes don't use background a lot, except in the pager, so this
never really came up.
2021-12-13 21:47:54 +01:00
Fabian Homborg
235581e8dc webconfig: Allow setting most pager colors
I'm not sure this ever worked before for most of these.

It currently still doesn't set the background, and the secondary
colors have a weird fallback.
2021-12-13 21:47:54 +01:00
Fabian Homborg
c75ecf9b03 webconfig: Allow setting a variable to empty 2021-12-13 21:47:54 +01:00
Aaron Gyes
84f5e9db20
Update create_manpage_completions.py 2021-12-13 04:33:26 -08:00
Aaron Gyes
cb10f34f2e web_config js: lots of undeclared local variables 2021-12-12 12:32:32 -08:00
Aaron Gyes
ba7d51503e deroff.py: unneccessarry pass, unreachable code 2021-12-12 10:45:50 -08:00
Aaron Gyes
e98fff5883 completion generator: globals at module-level are redundant
also add shebang.
2021-12-12 10:45:50 -08:00
Aaron Gyes
8e61255a04 LGTM report: for has redundant else, output is always overwrtitten
introduced by 2aec6e5814
2021-12-12 10:45:50 -08:00
Aaron Gyes
ff1aea3d96 unnecessary pass statement 2021-12-12 10:45:50 -08:00
Fabian Homborg
29fa8b776c themes/coolbeans: Make quotes less red
This was awkward to tell from the error color, which we want to keep red.
2021-11-28 12:50:00 +01:00
Fabian Homborg
2a1d59107f prompts/disco: Remove superfluous space from git prompt 2021-11-28 12:39:22 +01:00
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
Fabian Homborg
d4ce5507af Sample prompts: Rename classic+vcs to default
That's what it is, and without the "classic" prompt to compare it
doesn't make any sense anymore.
2021-04-08 11:14:16 +02:00
Fabian Homborg
34d4afac99 Sample prompts: Remove stray space after pipestatus
This would, with the default color, have an ugly red background.

So just remove the space.
2021-04-08 11:14:16 +02:00
Fabian Homborg
db9ac527af Sample prompts: Rename prompts named after a single person
Unless that person directly contributed the prompt.

We name them after a feature - the Scales prompt feature a ">>>" which
kinda looks like fish scales, the "Arrow" prompt starts with a
prominent "➜".

Naming them after people looks like an endorsement of that particular
person, and like they are someone to look up to, especially when they
aren't involved with the project.

The "terlar" and "acidhub" prompts stay for now because they
contributed the prompt themselves, they are also much less prominent.
2021-04-08 11:14:16 +02:00
Fabian Homborg
635a2c13f1 Sample prompts: Use fish_is_root_user
So we don't just check for "root"
2021-04-08 11:14:16 +02:00
Fabian Homborg
2bc2a92c9a Sample prompts: Stop using "git status" just to see if it is dirty
`git status` will descend the entire repo, which is *slooooow*
2021-04-08 11:14:16 +02:00
Fabian Homborg
31f86ed2cf Sample prompts: Use fish_git_prompt format string 2021-04-08 11:14:16 +02:00
Fabian Homborg
0a395b9568 Sample prompts: Remove default settings from informative vcs prompt
Some of these are just the git prompt defaults anyway, so remove them here.
2021-04-08 11:14:16 +02:00
Fabian Homborg
0586715696 Sample prompts: Remove duplicated or less useful prompts
The "classic" prompts are all just variations on a theme, let's just
keep the default classic+vcs.

"Justadollar" is very unlikely to be what you want and also trivial to
write yourself.

I have no idea what screen_savvy even is for - it reacts to "$WINDOW",
but I don't know anything that even uses that variable.

Lonetwin is just unremarkable, and the debian chroot prompt has one special feature that should be integrated into the other prompts.
2021-04-08 11:14:16 +02:00
Fabian Homborg
75a4e28e4f Manpage generator: Give better error when we can't understand manpath
This would just say "No paths specified", which is *true*, but then we
typically don't give paths, because we figure out the man path.
2021-03-26 19:32:14 +01:00
Johannes Altmanninger
516a70d9cb Misc cleanups
Some as suggested by lgtm.com
2021-03-21 19:41:36 +01:00
Fabian Homborg
c23f311956 pythonista prompt: Remove single-argument test 2021-03-11 16:55:17 +01:00