As an aside, this is also a good lesson to everyone to write robust tests. So I can't demo that particular feature as working. Unfortunately though, I also broke job control support again earlier this year and haven't had the spare time during the pandemic (my kids have been understandably more demanding of my time now that I'm working from home) to fix it. In Fish's case, they might be lower priority jobs. For me though, they were important problems to solve because few other lesser mainstream / alternative shells addressed those problems and thus they became all the more tantalising problems to solve. You say that but I'd been writing a shell in my spare time and I solved those problems over the course of a few weeks. (which is fair, these are very hard problems and it's an open-source project with finite resources) The relevant issues have been open for years with no clear resolution in sight. > It has some serious limitations as a scripting language, namely lack of proper subshell support and background process control. One can easily do both without "looking at the man page." There are many valid points which make zsh (or bash) hard to use out of the box, but neither of the points you've raised are one of them. Now you can easily change to your custom "foo" prompt by running "prompt foo". add the following to your zshrc: "autoload -Uz promptinit promptinit" define a function (can be autoloaded or not) named prompt_foo_setup to change your prompt Ta-da - turns out it doesn't have to be a pain in the neck to do that. > Want to make a function to dynamically set your shell's prompt? Create a function named "fish_prompt" in the file ~/.config/fish/functions/fish_prompt.fish. Add ~/.config/zsh/functions/foo to $fpath with "fpath+=~/.config/zsh/functions" Inside it, define the body of the function for foo Make a file named ~/.config/zsh/functions/foo > Now, create an autoloaded function in Zsh or Bash without looking at a man page. It's great for making functions for your interactive shell, but stick with sh or bash (or Python) for writing more sophisticated stuff. I completely agree about using it as a scripting language, though. Want to make a function to dynamically set your shell's prompt? Create a function named "fish_prompt" in the file ~/.config/fish/functions/fish_prompt.fish. There are a million little niceties like that where I'd assumed that a certain task had to be complicated because every shell I'd used before had made it complicated, but then Fish came up with a nice convention for making it simple. Now, create an autoloaded function in Zsh or Bash without looking at a man page. Now when you open a new shell and try to run the command "foo", Fish will look for the file named foo.fish in that directory, load and execute it, then call the foo function from in it. Inside it, define a function named "foo" Make a file named ~/.config/fish/functions/foo.fish Suppose you want to make an automatically loaded (that is, not defined in the shell's rc file) function called foo. Fish functions are just gorgeous, and what made me drop Zsh like a hot potato.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |