You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fish implements fish_config command that lets you view and select, but not editing, configurations.
It looks very cute, but to create a web server and then open a web browser to display the configurations seem a choice a little absurd.
I was expecting something more consistent as a classic ncurses menus, this would also permit to change configurations via tty, which is now unusable.
Reacted by gaborigloi, Kevin Mok, Rodolphe Pelloux-Prayer, Dennis Schridde, Brendan Zabarauskas and Dave Brown
Patches are welcomed. It's a small project with just a handful of regular committers. So if someone like yourself, @vbextreme, are passionate about improving fish in some way we'd love to work with you to make that happen.
Since we already have a dependency on python, and have no plans to remove that dependency, the natural place to implement this capability is in the share/tools/web_config/webconfig.py program (or a fork of it). Then modify the fish_config function to include a flag to select text versus web UIs.
I have the same issue as @vbextreme – running Fish on a server.
What I think would be already useful enough is if fish_config would produce an HTML page that can actually be used in a CLI web browser – whether that be lynx, elinks or w3m.
I predict issue #1916 won't be implemented anytime soon. Security is hard. Also, having a curses based solution has the advantage that it's running inside your terminal so accurately displaying colors, especially how they look given the terminals background color, becomes trivial. Personally I wish the person who implemented the web UI had instead spent the time creating a curses based UI.
A(n interim) lighter idea still might be to just have a CLI command to select (maybe even preview) prompts.
I've actually tried to do something like that. It'd be used like prompt view sorin. I kinda feel like this CLI feels a bit better than some dialog-like ncurses thing would.
One issue there is doing it without any accidental side-effects - you don't want previewing a prompt to change any variable in your running shell. That's easy enough to do for ours - we only set local or global variables, so just running it in a new fish process works.
In future I'd like to extend this to a "prompts" directory so you can add to the samples, that would make it a bit trickier (though you'd need to "audit" them anyway, since these files can contain arbitrary code).
There's also the issue of supporting a set of both left and right prompts - one possible solution is to use one directory per sample "theme", so we'd have a "sorin/" directory with a "fish_prompt.fish" and a "fish_right_prompt.fish" file. This is also more easily extendable to other functions (like "fish_greeting" and "fish_mode_prompt"), and would even allow using e.g. git-submodule.
One issue there is doing it without any accidental side-effects - you don't want previewing a prompt to change any variable in your running shell. That's easy enough to do for ours - we only set local or global variables, so just running it in a new fish process works.
You could simply start a new fish shell with the previewed prompt and then immediately quit it. Perhaps an additional flag to switch between a simple preview (new shell, that quits automatically) and a testing environment (new shell, with a start message that you should simply quit/logout/Ctrl+D when you’re done playing around) would make sense.
There's also the issue of supporting a set of both left and right prompts […]
I don’t follow how this is an issue, nor where the sorin/ folder comes from. Can you please elaborate?
You could simply start a new fish shell with the previewed prompt and then immediately quit it.
That's just what I did.
I don’t follow how this is an issue, nor where the sorin/ folder comes from. Can you please elaborate?
The "sorin" prompt contains both a fish_prompt and a fish_right_prompt function. We currently don't save the right_prompt even in fish_config.
Though I explained that wrong (coffee hadn't taken effect yet, I guess) - the issue isn't with those two functions since we can just handle them, the issue is actually with arbitrary helper functions and code outside of any function (e.g to set cached variables). Though we could just copy the entire file to fish_prompt.fish (which wouldn't be as clean as I'd like).
Anyway, all that stuff is also an issue with fish_config, so we can also handle it later.
I'll play around with this a bit more to figure out what it should be able to do and how it should work when setting a prompt.
You could simply start a new fish shell with the previewed prompt and then immediately quit it.
That's just what I did.
Hehe, tea hasn’t kicked in here yet either 😸 🍵
The "sorin" prompt contains both a fish_prompt and a fish_right_prompt function. We currently don't save the right_prompt even in fish_config.
[…]
Anyway, all that stuff is also an issue with fish_config, so we can also handle it later.
That makes sense.
I think if a CLI command for the normal/left-hand prompt can be implemented, that would already be of great help for most users who don’t use a DE/WM.
Later we can extend it to also manage the right-hand prompt and seeing as this is an issue also with fish_config, that might make sense to be solved on the level of theme “packages”.
I'll play around with this a bit more to figure out what it should be able to do and how it should work when setting a prompt.
You rock! I’m happy to test it, if you have anything public yet.
Okay, with #8132 (themes) and #7958 (prompts) done and providing a CLI to select these things, I'm closing this.
The rest is already available - you can alter history with history, modify functions with funced, change abbreviations with abbr, bindings with bind and set variables with set. There is now nothing the web config tool can do that you can't do in the shell itself.
Activity
krader1961 commentedon Dec 6, 2016
Patches are welcomed. It's a small project with just a handful of regular committers. So if someone like yourself, @vbextreme, are passionate about improving fish in some way we'd love to work with you to make that happen.
Since we already have a dependency on python, and have no plans to remove that dependency, the natural place to implement this capability is in the share/tools/web_config/webconfig.py program (or a fork of it). Then modify the
fish_configfunction to include a flag to select text versus web UIs.vbextreme commentedon Dec 6, 2016
thanks for the information.
I hope to recover a bit 'of time to add the new functionality.
silverhook commentedon Dec 10, 2016
I have the same issue as @vbextreme – running Fish on a server.
What I think would be already useful enough is if
fish_configwould produce an HTML page that can actually be used in a CLI web browser – whether that be lynx, elinks or w3m.silverhook commentedon Dec 17, 2016
A different solution to the same problem is also being discussed in bug #1916.
krader1961 commentedon Dec 17, 2016
I predict issue #1916 won't be implemented anytime soon. Security is hard. Also, having a curses based solution has the advantage that it's running inside your terminal so accurately displaying colors, especially how they look given the terminals background color, becomes trivial. Personally I wish the person who implemented the web UI had instead spent the time creating a curses based UI.
silverhook commentedon Dec 17, 2016
Personally, I agree.
But I see how having docs and settings in browser does make it more appealing to the modern-day crowd, so I don’t see it going away any time soon.
Having a good ncurses option for
fish_configdoes seem like a sterling idea though.A(n interim) lighter idea still might be to just have a CLI command to select (maybe even preview) prompts.
faho commentedon Dec 17, 2016
I've actually tried to do something like that. It'd be used like
prompt view sorin. I kinda feel like this CLI feels a bit better than somedialog-like ncurses thing would.One issue there is doing it without any accidental side-effects - you don't want previewing a prompt to change any variable in your running shell. That's easy enough to do for ours - we only set local or global variables, so just running it in a new fish process works.
In future I'd like to extend this to a "prompts" directory so you can add to the samples, that would make it a bit trickier (though you'd need to "audit" them anyway, since these files can contain arbitrary code).
There's also the issue of supporting a set of both left and right prompts - one possible solution is to use one directory per sample "theme", so we'd have a "sorin/" directory with a "fish_prompt.fish" and a "fish_right_prompt.fish" file. This is also more easily extendable to other functions (like "fish_greeting" and "fish_mode_prompt"), and would even allow using e.g. git-submodule.
silverhook commentedon Dec 17, 2016
You could simply start a new
fishshell with the previewed prompt and then immediately quit it. Perhaps an additional flag to switch between a simple preview (new shell, that quits automatically) and a testing environment (new shell, with a start message that you should simply quit/logout/Ctrl+D when you’re done playing around) would make sense.I don’t follow how this is an issue, nor where the
sorin/folder comes from. Can you please elaborate?faho commentedon Dec 17, 2016
That's just what I did.
The "sorin" prompt contains both a
fish_promptand afish_right_promptfunction. We currently don't save the right_prompt even in fish_config.Though I explained that wrong (coffee hadn't taken effect yet, I guess) - the issue isn't with those two functions since we can just handle them, the issue is actually with arbitrary helper functions and code outside of any function (e.g to set cached variables). Though we could just copy the entire file to fish_prompt.fish (which wouldn't be as clean as I'd like).
Anyway, all that stuff is also an issue with fish_config, so we can also handle it later.
I'll play around with this a bit more to figure out what it should be able to do and how it should work when setting a prompt.
silverhook commentedon Dec 17, 2016
Hehe, tea hasn’t kicked in here yet either 😸 🍵
That makes sense.
I think if a CLI command for the normal/left-hand prompt can be implemented, that would already be of great help for most users who don’t use a DE/WM.
Later we can extend it to also manage the right-hand prompt and seeing as this is an issue also with
fish_config, that might make sense to be solved on the level of theme “packages”.You rock! I’m happy to test it, if you have anything public yet.
markkuit commentedon Dec 10, 2017
Are there no further updates on this matter?
faho commentedon Dec 10, 2017
Nope. I haven't been working on this. I'm reasonably certain what would roughly be required:
The prompts would need to move out of the web_config directory
They'd have to move into one directory per prompt (so the sorin prompt gets prompts/sorin to itself), with each function into its own file
fish_config would have to be adjusted for that
A
fish_cli_configutility would start a new fish instance that sources that directoryIf anyone wants to pick it up, feel free to do so! I haven't had as much time to work on fish as I'd like.
Add prompt selector
Add prompt selector
Add prompt selector
Add prompt selector
Add prompt selector
Add prompt selector
faho commentedon Jul 15, 2021
Okay, with #8132 (themes) and #7958 (prompts) done and providing a CLI to select these things, I'm closing this.
The rest is already available - you can alter history with
history, modify functions withfunced, change abbreviations withabbr, bindings withbindand set variables withset. There is now nothing the web config tool can do that you can't do in the shell itself.