Re: [Fish-users] $status in prompt

2012-07-10 Thread Dario Bertini
I've done 2 very small pull requests:

https://github.com/fish-shell/fish-shell/pull/220
https://github.com/fish-shell/fish-shell/pull/221

I was about to add documentation for the echo builtin... but then I
realized that it has already been written and it's there in my local
checkout, so apparently even the online documentation is a bit
outdated:
http://ridiculousfish.com/shell/user_doc/html/index.html#echo

I guess it still hasn't been setup to be automatically updated? (the
first pull request is for the pwd command doc... not very useful, but
at least now the builtins are complete)

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] $status in prompt

2012-07-09 Thread Dario Bertini
On 9 July 2012 04:16, Kevin Ballard ke...@sb.org wrote:
 What should be documented? The fact that running commands overwrites $status?


obviously not: I'm talking about the fact that $status behaves like a
global variable that gets rebinded locally in every function


http://dpaste.com/hold/768717/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] $status in prompt

2012-07-09 Thread Dario Bertini
On 9 July 2012 22:14, David Frascone d...@frascone.com wrote:
 $status, like $? in bash, will be overwritten by EVERY command executed.

 So, given an abridged version of your example:

 codemonkey@monkeytree ~/W/grive function dummy

  nonexistant command

  echo $status

  end

 codemonkey@monkeytree ~/W/grive dummy

 fish: Unknown command “nonexistant”

 Standard input: nonexistant command

 ^

 in function “dummy”,

 called on standard input,


 nonexistant: command not found

 127

 codemonkey@monkeytree ~/W/grive echo $status
 0
 codemonkey@monkeytree ~/W/grive


 The 'nonexistant' command sets the status to 127, which is displayed, but,
 since the echo executes after the error, echo itself returned zero, which
 then zero'ed out the status.

 In the discussion of setting your prompt, that's why you have to store the
 value.  $status is volatile, and will change after every command.  Just like
 $? in other shells.

 Hope this helps,


 -Dave


Do you really think I could had written that example without
understanding what you just explained?

moreover: just try adding unexistantcommand at the bottom of your
fish_prompt function: you'll see that it's more complicated than that
(due to the fact that other shells usually compose their prompt with
an env variable with is own syntax, while fish chose a more flexible
-and simpler- approach)

I don't want to get through as being hostile, but I'm getting quite
frustrated by this back and forth...

the issue is imho very simple:

either this is recognized as a true inconsistency, and it's chosen to
be dealt with by adding something to the documentation

or you don't see this as truly inconsistent, and you think I should've
thought out better my fish_prompt function in the first place

either of these decisions are fine, let's just try to settle it with
just few more words, okay? :)

Peace

:Dario

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] $status in prompt

2012-07-08 Thread Kevin Ballard
What should be documented? The fact that running commands overwrites $status?

-Kevin

On Jul 8, 2012, at 8:59 AM, Dario Bertini berda...@gmail.com wrote:

 On 1 July 2012 23:14, ridiculous_fish corydo...@ridiculousfish.com wrote:
 I wasn't able to reproduce this. If you share your fish_prompt function, I 
 can dig into it a bit more.
 
 
 this is my current function:
 
 http://dpaste.com/768437/
 
 as I said: this works, thanks to the suggestion of Tom Most... but if
 you remove the 3rd line, it doesn't work...
 
 that's fine, I guess... but it should be documented in the help

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] $status in prompt

2012-07-01 Thread ridiculous_fish
I wasn't able to reproduce this. If you share your fish_prompt function, I can 
dig into it a bit more.

_fish

On Jun 21, 2012, at 5:23 PM, Dario Bertini wrote:

 In my fish_prompt function I added the $status variable, to let me
 instantly know the exit code of the last command I run (like in the
 old prompt I was using on zsh)
 
 but in my prompt, the value is always stuck to 0
 
 is someone else able to reproduce it? is it a known behaviour? is it a bug?
 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users
 


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] $status in prompt

2012-06-21 Thread Dario Bertini
In my fish_prompt function I added the $status variable, to let me
instantly know the exit code of the last command I run (like in the
old prompt I was using on zsh)

but in my prompt, the value is always stuck to 0

is someone else able to reproduce it? is it a known behaviour? is it a bug?

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] $status in prompt

2012-06-21 Thread Dario Bertini
On 22 June 2012 02:43, Tom W. Most tomm...@gmail.com wrote:
 It works for me, but of course it does need to be referenced in the
 first statement in the prompt.  This is my prompt:


Thank you, it works...

but it seems a bit unintuitive that it has to be the first statement:

I mean, fish_prompt is called each time, so having some other
instructions inside would reset the $status, and then I don't see how
it could still contain the correct value, after returning from
fish_prompt

whatever... now I don't have to worry about it anymore, thanks :)

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users