Skip to content

fish_config should have a text UI #3625

Closed

Description

@vbextreme

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.

Activity

  1. krader1961 commented on Dec 6, 2016

    @krader1961
    Contributor

    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.

  2. vbextreme commented on Dec 6, 2016

    @vbextreme
    Author

    thanks for the information.
    I hope to recover a bit 'of time to add the new functionality.

  3. silverhook commented on Dec 10, 2016

    @silverhook

    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.

  4. silverhook commented on Dec 17, 2016

    @silverhook

    A different solution to the same problem is also being discussed in bug #1916.

  5. krader1961 commented on Dec 17, 2016

    @krader1961
    Contributor

    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.

  6. silverhook commented on Dec 17, 2016

    @silverhook

    Personally I wish the person who implemented the web UI had instead spent the time creating a curses based UI.

    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_config does 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.

  7. faho commented on Dec 17, 2016

    @faho
    Member

    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.

  8. silverhook commented on Dec 17, 2016

    @silverhook

    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?

  9. faho commented on Dec 17, 2016

    @faho
    Member

    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.

  10. silverhook commented on Dec 17, 2016

    @silverhook

    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.

  11. markkuit commented on Dec 10, 2017

    @markkuit

    Are there no further updates on this matter?

  12. faho commented on Dec 10, 2017

    @faho
    Member

    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_config utility would start a new fish instance that sources that directory

    If 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.

  13. faho commented on Jul 15, 2021

    @faho
    Member

    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.

  14. modified the milestones: fish-future, fish 3.4.0 on Jul 15, 2021
  15. locked as resolved and limited conversation to collaborators on Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions