Jan-Thorsten Peter | 10 Jul 08:27 2014
Picon
Picon

Setting up a per directory history

Hi,
I'm trying to setup a per directory history by saving each command executed in a directory to a local file. It come down to add a line like this:
   echo (date +%F.%H-%M-%S) $history[1] >> .history.$USER
to the fish_prompt function. The problem is that $history[1] does not contain the current command, but the previous.
So if the previous command was "echo FOO" and the current command is "echo BAR" it would save "echo FOO" to the history file instead of "echo BAR".
Is there a way to get the current command?
Beside is it also possible to execute a function like this before the actual command is executed and not like the fish_prompt function after the command already finished?
Any other way to saving the current command to a file in the current directory?

P.S.: I'm just giving fish a try coming from zsh. So far really impressive! It gives me a shell that behaves the way I like it with a lot less configuration effort. Thanks a lot for your work!
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Michael Stillwell | 9 Jul 12:49 2014

Idiomatic default values for functions

Does fish have a short equivalent to bash's "use default values" (i.e.
${parameter:-word})? I'd like to use this to provide default values to
functions without having to write out laborious if ... else ... end
chains.

Michael

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
David Adam | 3 Jul 10:22 2014
Picon
Picon
Picon

Re: bash equivalent of eval

On Wed, 2 Jul 2014, Wai Yan Pong wrote:
> What would be the fish equivalent of the bash command
> 
> eval `prog < file`
> 
> I was trying
> 
> eval `slmenu < prog.txt`

See the FAQ: http://fishshell.com/docs/current/faq.html#faq-subcommand

You can use
   eval (prog < file)

David Adam
zanchey@...

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Wai Yan Pong | 3 Jul 08:05 2014
Picon

bash equivalent of eval

What would be the fish equivalent of the bash command

eval `prog < file`

I was trying

eval `slmenu < prog.txt`
 
which works for me in bash but not in fish.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Alex Boisvert | 25 Jun 02:27 2014
Picon

arrays and newlines (\n)

Wanted to bring up an issue that I run into occasionally.

I'll save the output of a command into a variable (array),

% set foo (some command)

Unfortunately, when I try to pipe `foo` into another command through `psub`:

% command (echo $foo | psub)

The newlines (\n) from the output of the original command are not passed-in ... a subtle change in content semantic.

Is there a trick I'm missing or generally a better way of doing things?

thanks!

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Ryan Burnett | 18 Jun 22:30 2014
Picon

Add .bash_profile commands to fish

I discovered a nice collection of .bash_profile commands and would like to add this one to fish:

mcd () { mkdir -p "$1" && cd "$1"; }

I've tried adding this to config.fish with no luck:

function mcd
  mkdir -p "$1" && cd "$1";
end

Any idea how to add the above command to fish?
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Ryan Burnett | 18 Jun 15:17 2014
Picon

Re: Change default path from ~/ to ~/Sites

<at> David

I'm trying to change my staring path from ~/ to ~/Sites (i.e. so I don't have to "cd Sites" each time).

<at> Maher

I added the "-x" flag but Terminal's still starting at ~/

if status --is-login
set -x PATH $PATH ~/Sites
end

How can I change my staring path to ~/Sites?


On Wed, Jun 18, 2014 at 1:58 AM, ماهر الخطيب <maher.add-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
use the set option: -x


On Tue, Jun 17, 2014 at 10:21 PM, Ryan Burnett <ryanjburnett-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I'm having trouble changing my default shell path from ~/ to ~/Sites.

I've added this to ~/.config/fish/config.fish

if status --is-login
  set PATH $PATH ~/Sites
end

Any idea what I'm doing wrong?

P.S. I'm running OS X 10.9.3 and fish 2.1.

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users




--


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Ryan Burnett | 17 Jun 21:21 2014
Picon

Change default path from ~/ to ~/Sites

I'm having trouble changing my default shell path from ~/ to ~/Sites.

I've added this to ~/.config/fish/config.fish

if status --is-login
  set PATH $PATH ~/Sites
end

Any idea what I'm doing wrong?

P.S. I'm running OS X 10.9.3 and fish 2.1.
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Alex Boisvert | 16 Jun 16:42 2014
Picon

fish and percol

Wondering if any of you have experienced (and can explain) why the following doesn't work in fish 2.0.0:

% cat (ls | percol)

but the same works as expected  in bash:

% cat $(ls | percol)

(Project documentation + source for percol can be found at https://github.com/mooz/percol)

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Ryan Burnett | 12 Jun 19:16 2014
Picon

Re: Enable fish in WebStorm's Terminal

echo $SHELL;

Terminal
/usr/local/bin/fish

WebStorm Terminal
/bin/bash

Changed the WebStorm Terminal Shell path to '/usr/local/bin/fish' and it's running fish perfectly now!

Weird thing is, the WebStorm Terminal's 'echo $SHELL;' is still returning '/bin/bash' but is clearly using fish now after the above settings change. Clearly a bug, but it's running fish now and that's what I wanted. 

Thanks Charlie :)


On Thu, Jun 12, 2014 at 1:02 PM, charlie <charlie.fats-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hmm no, thats how I set mine.  What does

echo $SHELL;

say ?  In the terminal, and the webstorm terminal ?


On Thu, Jun 12, 2014 at 11:51 AM, Ryan Burnett <ryanjburnett <at> gmail.com> wrote:
I set fish as my default shell by running:

chsh -s /usr/local/bin/fish

fish appears in Terminal but not the WebStorm Terminal. 

Is there a different way I should set fish as the default shell?


On Thu, Jun 12, 2014 at 12:46 PM, charlie <charlie.fats-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Is Fish your default shell ?  I'm running fish as my terminal in WebStorm and I didn't have to change settings it just showed up, but I have fish set as my main shell in /etc/passwrd 


On Thu, Jun 12, 2014 at 8:34 AM, Ryan Burnett <ryanjburnett-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
How can I enable fish inside WebStorm's Terminal? 

You can see this in action here (0:27):

My WebStorm Terminal Settings Shell path is set to /bin/bash

Any idea how to enable fish in WebStorm?

P.S. I'm running OS X 10.9.3, WebStorm 8.0.3 and fish 2.1.

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users




--
Thanks!
Charlie




--
Thanks!
Charlie

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Ryan Burnett | 12 Jun 15:34 2014
Picon

Enable fish in WebStorm's Terminal

How can I enable fish inside WebStorm's Terminal? 

You can see this in action here (0:27):

My WebStorm Terminal Settings Shell path is set to /bin/bash

Any idea how to enable fish in WebStorm?

P.S. I'm running OS X 10.9.3, WebStorm 8.0.3 and fish 2.1.
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users

Gmane