Re: [Fish-users] why all the questions?
In case you haven't seen it, there's a vibrant support community at stackoverflow.com/questions/tagged/fish On Aug 20, 2017 5:43 PM, "Mark Volkmann"wrote: > I hope I'm not being too annoying with all the questions I've been asking. > Obviously I'm new to fish. > > I'm working on writing a long article about it that I'll publish on > November 1. I want to try to bring more attention to this incredible thing > that many of you on this mailing list have helped to build. I have a good > start on the article ... 28 pages of notes! If you're curious, you can see > them at https://github.com/mvolkmann/MyUnixEnv/blob/ > master/notes/FishNotes.txt. I'm constantly adding to this and will use it > as the starting point of my article. > > -- > R. Mark Volkmann > Object Computing, Inc. > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users > > -- -- -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] why all the questions?
So glad to see that associative arrays are targeted for fish 3! On Sun, Aug 20, 2017 at 5:15 PM, Kurtis Raderwrote: > On Sun, Aug 20, 2017 at 2:42 PM, Mark Volkmann > wrote: > >> I hope I'm not being too annoying with all the questions I've been >> asking. Obviously I'm new to fish. >> >> I'm working on writing a long article about it that I'll publish on >> November 1. I want to try to bring more attention to this incredible thing >> that many of you on this mailing list have helped to build. I have a good >> start on the article ... 28 pages of notes! If you're curious, you can see >> them at https://github.com/mvolkmann/MyUnixEnv/blob/master/notes/ >> FishNotes.txt. I'm constantly adding to this and will use it as the >> starting point of my article. >> > > No worries. Thanks for the heads up. We definitely want to help ensure > your article is as accurate as possible. > > I notice the top of your notes asks how `foo; bar` differs from `foo; and > bar`. The `and` keyword is roughly analogous to `foo && bar` in POSIX > shells like bash. The `bar` command will only run if `foo` exits with a > success (zero) status. The reason for the difference is that fish prefers > keeping syntax to a minimum and doing as much as possible via commands. > > You ask "Seems to be primarily implemented in C++." That is true. The > original 1.x releases were in C. Then @ridiculous fish and others rewrote > it in C++. > > This statement, "for Window, can only run in Cygwin", isn't true. While we > do not, and probably will never support fish as a native command > interpreter it can be used in Cygwin and the new Windows 10 "bash" > environment (more accurately known as "Windows Subsystem for Linux" or WSL). > > I see you noticed `fish_indent`. Take a look at `fish_key_reader` too. > > Given that you represent a fresh pair of eyes and from looking at your > notes clearly been trying to learn as much from the fish docs as possible > we'd love feedback. Software engineers prefer writing code to documentation > so we don't always give the latter the attention it deserves. > > Also, keep in mind that fish 3.0, hopefully released 2018Q1, will have > many improvements and cleanups. Among them will be replacing the use of > `bc` to evaluate math expressions with a builtin command. We already merged > changes that can make manipulating fish variables up to 40% faster. See > https://github.com/fish-shell/fish-shell/milestone/18 for the current > working list. There are many other changes we can only do in a major > release that might make it into 3.0. See https://github.com/fish- > shell/fish-shell/milestone/7 for other items that might make it into 3.0. > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] writing error messages
On Sun, Aug 20, 2017 at 6:02 AM, Mark Volkmannwrote: > What is the recommended way to write out error messages from a fish > function so they appear in the color that has been configured for error > messages (typically red)? It seems simply writing to stderr is not the > answer. > Glenn's answer works but if you want to ensure you're using whatever color standard fish code uses you should use the `$fish_color_error` variable; e.g., `echo (set_color $fish_color_error)my error message(set_color normal) >&2`. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] why all the questions?
On Sun, Aug 20, 2017 at 3:28 PM, Mark Volkmannwrote: > On Sun, Aug 20, 2017 at 5:15 PM, Kurtis Rader > wrote: >> >> This statement, "for Window, can only run in Cygwin", isn't true. While >> we do not, and probably will never support fish as a native command >> interpreter it can be used in Cygwin and the new Windows 10 "bash" >> environment (more accurately known as "Windows Subsystem for Linux" or WSL). >> > > Are there notes somewhere that describe how to get fish to run in the > Windows 10 bash environment? > That seems preferable over using Cygwin. > Not yet. When we started work to ensure fish would run inside WSL that environment was still in beta status. In theory using the ready made Debian/Ubuntu packages should work. I suspect most of us who have tested fisn inside WSL have built it from source. > Also, keep in mind that fish 3.0, hopefully released 2018Q1, will have >> many improvements and cleanups. Among them will be replacing the use of >> `bc` to evaluate math expressions with a builtin command. We already merged >> changes that can make manipulating fish variables up to 40% faster. See >> https://github.com/fish-shell/fish-shell/milestone/18 for the current >> working list. There are many other changes we can only do in a major >> release that might make it into 3.0. See https://github.com/fish-sh >> ell/fish-shell/milestone/7 for other items that might make it into 3.0. >> > > Is fish 3 far enough along that I should be learning in that version or do > you think I should wait for the official release? > I recommend new users wait for the official release. The vast majority of the changes won't break anything people are already doing with fish but it's always a possibility since the whole point of a major release is to take some risks. Specifically, making changes that might break existing fish scripts. And we're currently making changes at a fast rate so you'll only want to use the bleeding edge version if you're willing to risk some pain. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] why all the questions?
On Sun, Aug 20, 2017 at 2:42 PM, Mark Volkmannwrote: > I hope I'm not being too annoying with all the questions I've been asking. > Obviously I'm new to fish. > > I'm working on writing a long article about it that I'll publish on > November 1. I want to try to bring more attention to this incredible thing > that many of you on this mailing list have helped to build. I have a good > start on the article ... 28 pages of notes! If you're curious, you can see > them at https://github.com/mvolkmann/MyUnixEnv/blob/ > master/notes/FishNotes.txt. I'm constantly adding to this and will use it > as the starting point of my article. > No worries. Thanks for the heads up. We definitely want to help ensure your article is as accurate as possible. I notice the top of your notes asks how `foo; bar` differs from `foo; and bar`. The `and` keyword is roughly analogous to `foo && bar` in POSIX shells like bash. The `bar` command will only run if `foo` exits with a success (zero) status. The reason for the difference is that fish prefers keeping syntax to a minimum and doing as much as possible via commands. You ask "Seems to be primarily implemented in C++." That is true. The original 1.x releases were in C. Then @ridiculous fish and others rewrote it in C++. This statement, "for Window, can only run in Cygwin", isn't true. While we do not, and probably will never support fish as a native command interpreter it can be used in Cygwin and the new Windows 10 "bash" environment (more accurately known as "Windows Subsystem for Linux" or WSL). I see you noticed `fish_indent`. Take a look at `fish_key_reader` too. Given that you represent a fresh pair of eyes and from looking at your notes clearly been trying to learn as much from the fish docs as possible we'd love feedback. Software engineers prefer writing code to documentation so we don't always give the latter the attention it deserves. Also, keep in mind that fish 3.0, hopefully released 2018Q1, will have many improvements and cleanups. Among them will be replacing the use of `bc` to evaluate math expressions with a builtin command. We already merged changes that can make manipulating fish variables up to 40% faster. See https://github.com/fish-shell/fish-shell/milestone/18 for the current working list. There are many other changes we can only do in a major release that might make it into 3.0. See https://github.com/fish-shell/fish-shell/milestone/7 for other items that might make it into 3.0. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] writing error messages
Perfect! That's what I was looking for. On Sun, Aug 20, 2017 at 5:21 PM, Kurtis Raderwrote: > On Sun, Aug 20, 2017 at 6:02 AM, Mark Volkmann > wrote: > >> What is the recommended way to write out error messages from a fish >> function so they appear in the color that has been configured for error >> messages (typically red)? It seems simply writing to stderr is not the >> answer. >> > > Glenn's answer works but if you want to ensure you're using whatever color > standard fish code uses you should use the `$fish_color_error` variable; > e.g., `echo (set_color $fish_color_error)my error message(set_color normal) > >&2`. > > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] why all the questions?
On Sun, Aug 20, 2017 at 5:15 PM, Kurtis Raderwrote: > On Sun, Aug 20, 2017 at 2:42 PM, Mark Volkmann > wrote: > >> I hope I'm not being too annoying with all the questions I've been >> asking. Obviously I'm new to fish. >> >> I'm working on writing a long article about it that I'll publish on >> November 1. I want to try to bring more attention to this incredible thing >> that many of you on this mailing list have helped to build. I have a good >> start on the article ... 28 pages of notes! If you're curious, you can see >> them at https://github.com/mvolkmann/MyUnixEnv/blob/master/notes/ >> FishNotes.txt. I'm constantly adding to this and will use it as the >> starting point of my article. >> > > No worries. Thanks for the heads up. We definitely want to help ensure > your article is as accurate as possible. > I'll keep you informed on my progress so that you and others have a chance to provide feedback if you'd like to do that. > This statement, "for Window, can only run in Cygwin", isn't true. While we > do not, and probably will never support fish as a native command > interpreter it can be used in Cygwin and the new Windows 10 "bash" > environment (more accurately known as "Windows Subsystem for Linux" or WSL). > Are there notes somewhere that describe how to get fish to run in the Windows 10 bash environment? That seems preferable over using Cygwin. > Given that you represent a fresh pair of eyes and from looking at your > notes clearly been trying to learn as much from the fish docs as possible > we'd love feedback. > Will do! > Also, keep in mind that fish 3.0, hopefully released 2018Q1, will have > many improvements and cleanups. Among them will be replacing the use of > `bc` to evaluate math expressions with a builtin command. We already merged > changes that can make manipulating fish variables up to 40% faster. See > https://github.com/fish-shell/fish-shell/milestone/18 for the current > working list. There are many other changes we can only do in a major > release that might make it into 3.0. See https://github.com/fish- > shell/fish-shell/milestone/7 for other items that might make it into 3.0. > Is fish 3 far enough along that I should be learning in that version or do you think I should wait for the official release? -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] funced and funcsave
You are correct. I have this in my config.fish: alias rm 'rm -i' I definitely don't want to change that alias because it helps me to avoid accidentally deleting the wrong file by forcing me to think about it one more time. But of course it's annoying that funced asks me about a file that I probably shouldn't know about. Maybe a switch could be added to funced to tell it to use "rm -f" for removing the temporary so doing that is optional. On Sun, Aug 20, 2017 at 10:15 AM, Kurtis Raderwrote: > On Sun, Aug 20, 2017 at 4:49 AM, Mark Volkmann > wrote: >> >> A related question: >> Why does funced ask this question on exit? >> "remove /var/folders/jc/q4_2lrkd3pn2sz1l_s8rf31wgn/T//fish. >> DjETfi/baz.fish?" >> Is that where it saves temporary (what I referred to as in-memory) >> functions? >> That isn't addressed in the help for funced. >> I'm not sure how my answer to that question affects the function. >> > > Technically funced is not asking that question; it's the `rm` command that > funced executes to remove the temporary file it created. The temporary file > is an implementation detail and thus not documented. Apparently you have > done something like `alias rm rm -i`. It might make sense to modify > `funced` to do `rm -f` to override the `-i` option. I don't like doing > that, however, because it also suppresses legitimate errors. > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] writing error messages
Use the `set_color` command: $ printf "normal"; set_color red; printf ":ERROR:"; set_color normal; echo normal On Sun, Aug 20, 2017 at 9:02 AM, Mark Volkmannwrote: > What is the recommended way to write out error messages from a fish > function so they appear in the color that has been configured for error > messages (typically red)? It seems simply writing to stderr is not the > answer. > > -- > R. Mark Volkmann > Object Computing, Inc. > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users > > -- *Glenn Jackman* Senior Software Developer *Pythian - Love your data* jack...@pythian.com Tel: +1 613 565 8696 Ext. 1478 Mobile: +1 613 808 4984 www.pythian.com -- -- -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] funced and funcsave
On Sun, Aug 20, 2017 at 4:49 AM, Mark Volkmannwrote: > > A related question: > Why does funced ask this question on exit? > "remove /var/folders/jc/q4_2lrkd3pn2sz1l_s8rf31wgn/T/ > /fish.DjETfi/baz.fish?" > Is that where it saves temporary (what I referred to as in-memory) > functions? > That isn't addressed in the help for funced. > I'm not sure how my answer to that question affects the function. > Technically funced is not asking that question; it's the `rm` command that funced executes to remove the temporary file it created. The temporary file is an implementation detail and thus not documented. Apparently you have done something like `alias rm rm -i`. It might make sense to modify `funced` to do `rm -f` to override the `-i` option. I don't like doing that, however, because it also suppresses legitimate errors. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] history of fish
On Sun, 20 Aug 2017, David Adam wrote: > On Sun, 20 Aug 2017, Mark Volkmann wrote: > > How old is fish? > > > > Looking at the GitHub repo I see the oldest release there was on > > 10/22/2005. Were there earlier versions somewhere else? > > > > Who were the original creators? > > Wikipedia says the first release was on 13 Februrary 2002, although I've > never been able to verify that. Sorry, should read 2005. [DAA] > Axel Liljencrantz was the main developer and maintainer of versions 1.0 to > 1.23.1. Development was, I believe, largely done via the mailing list and > the SourceForge site. > > Unfortunately he got a bit busy and the last 1.x release was in March > 2009. Various people maintained forks at Gitorious and elsewhere, but no > releases were ever made as far as I know. > > ridiculousfish got involved in about 2012 and released a beta of a fork > called fishfish. This brought in a lot of the work of previous fish > contributors, and I believe was blessed by Axel to become fish 2.0 > officially. > > Five years later (seems hard to believe!) we are looking at releasing fish > 3.0 next year. > > David Adam > fish committer (since May 2013) > zanc...@ucc.gu.uwa.edu.au > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users > Cheers, David Adam zanc...@ucc.gu.uwa.edu.au Ask Me About Our SLA! -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
[Fish-users] writing error messages
What is the recommended way to write out error messages from a fish function so they appear in the color that has been configured for error messages (typically red)? It seems simply writing to stderr is not the answer. -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] history of fish
On Sun, 20 Aug 2017, Mark Volkmann wrote: > How old is fish? > > Looking at the GitHub repo I see the oldest release there was on > 10/22/2005. Were there earlier versions somewhere else? > > Who were the original creators? Hi Mark, Wikipedia says the first release was on 13 Februrary 2002, although I've never been able to verify that. Axel Liljencrantz was the main developer and maintainer of versions 1.0 to 1.23.1. Development was, I believe, largely done via the mailing list and the SourceForge site. Unfortunately he got a bit busy and the last 1.x release was in March 2009. Various people maintained forks at Gitorious and elsewhere, but no releases were ever made as far as I know. ridiculousfish got involved in about 2012 and released a beta of a fork called fishfish. This brought in a lot of the work of previous fish contributors, and I believe was blessed by Axel to become fish 2.0 officially. Five years later (seems hard to believe!) we are looking at releasing fish 3.0 next year. David Adam fish committer (since May 2013) zanc...@ucc.gu.uwa.edu.au -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
[Fish-users] history of fish
How old is fish? Looking at the GitHub repo I see the oldest release there was on 10/22/2005. Were there earlier versions somewhere else? Who were the original creators? -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] funced and funcsave
On Sat, Aug 19, 2017 at 9:33 PM, Kurtis Raderwrote: > On Sat, Aug 19, 2017 at 6:42 PM, Mark Volkmann > wrote: > >> These are really cool utilities! >> Let's see if I understand them correctly. >> I can enter "funced foo" and create a new function named "foo". >> I can immediate execute that by entering "foo". >> But if I exit the session, I'll lose it. >> I can enter "funcsave foo" and it will be written to >> ~/.config/fish/functions/foo.fish. >> Then it will be available in all future sessions. >> Great! >> >> Later I can edit it again with "funced foo". >> However, that just edits the in-memory version of the function. >> It doesn't write the changes to the file unless I run "funcsave foo" >> again. >> >> I was expecting that funced might realize the function was already saved >> to a file and save the changes there. Either that or I thought there would >> be a switch on funced to tell it to do that. >> >> I'm curious why neither of those is the way it works. >> > > First, while `funced` can be used to create a function on the fly it's > primary purpose is to edit an existing function. If I run `funced` more > often than not I am testing something such as a change to my `fish_prompt` > function. And because I'm testing something I do not want that change to be > automatically reflected in the autoloaded script. If I do want a permanent > change I can either run `funced` followed by `funcsave` or just directly > edit the autoloaded script in ~/.config/fish/functions. Existing fish > sessions will notice within a few seconds that the script file has changed > and reload it. > Thanks for explaining that! It looks like I can get what I want by writing a function that does this: set fnpath $fish_function_path[1] funced $name; and funcsave $name; and source $fnpath/$name'.fish' A related question: Why does funced ask this question on exit? "remove /var/folders/jc/q4_2lrkd3pn2sz1l_s8rf31wgn/T//fish.DjETfi/baz.fish?" Is that where it saves temporary (what I referred to as in-memory) functions? That isn't addressed in the help for funced. I'm not sure how my answer to that question affects the function. -- R. Mark Volkmann Object Computing, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] timing of function updates
I find this a bit annoying as well. Took me a little while to realise this, but when editing/debugging a function, a workaround is to source the file immediately before running it: $ source foo.fish ; foo Michael On Sat, Aug 19, 2017 at 3:37 PM, David Adamwrote: > On Sat, 19 Aug 2017, Mark Volkmann wrote: > > I noticed that I can > > define a function in a .fish file that just echoes text, > > call the function as a command to see the text, > > modify the text in the file, > > save the file, > > run the function again and NOT see the change, > > run it again and see the change. > > Why is there a delay in seeing the result of the change? > > The delay seems to be about two seconds. > > fish will reload a function file if it hasn't been loaded in the > "staleness interval", which is currently fifteen seconds (this is an > implementation detail - don't rely on it being that long or short!) > > This is to avoid thrashing the filesystem when repeatedly calling the same > function - such as in scripts. Slow filesystems like NFS are particularly > vulnerable to this sort of problem. > > The value could possibly be tuned downwards a bit, but I think we would > want to have a discussion about that on GitHub. > > David Adam > fish committer > zanc...@ucc.gu.uwa.edu.au > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users