Re: [Fish-users] evaluating $COLUMNS in a loop

2013-09-18 Thread ridiculous_fish

On Sep 17, 2013, at 9:44 PM, Martin Bähr mba...@email.archlab.tuwien.ac.at 
wrote:

 On Wed, Sep 18, 2013 at 05:00:09AM +0200, Martin Bähr wrote:
 clear
 while true
echo \e\[H
for i in (ls -tr)
du -sh $i
end | tail -20 | sed -e 's/^/'\e'\[K/' | cut -c -(math $COLUMNS - 2)
sleep 2
 end
 
 one minor issue i still have is that in the above $COLUMNS appears to be
 evaluated only once. i'd like it to be reevaluated every time.
 
 is there a way to do that?

Hi Martin,

Try using 'tput cols' to get the terminal width instead.

Hope that helps,
_fish
--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151iu=/4140/ostg.clktrk
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] evaluating $COLUMNS in a loop

2013-09-18 Thread Martin Bähr
On Wed, Sep 18, 2013 at 12:15:59PM -0700, ridiculous_fish wrote:
  one minor issue i still have is that in the above $COLUMNS appears to be
  evaluated only once. i'd like it to be reevaluated every time.
  
  is there a way to do that?
 Try using 'tput cols' to get the terminal width instead.

oh, nice, that works, thanks!

btw: $LINES is broken, it has the columns value.
(built from http://fishshell.com/files/2.0.0/fish-2.0.0.tar.gz )

greetings, martin.
-- 
eKita   -   the online platform for your entire academic life
hackerspace beijing -http://qike.info
--
chief engineer   eKita.co
pike programmer  pike.lysator.liu.se  caudium.net
foresight developer  realss.comforesightlinux.org
unix sysadmintrainer   developersocietyserver.org
Martin Bähr  working in chinahttp://societyserver.org/mbaehr/

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151iu=/4140/ostg.clktrk
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] evaluating $COLUMNS in a loop

2013-09-18 Thread David Adam
On Thu, 19 Sep 2013, Martin Bähr wrote:
 On Wed, Sep 18, 2013 at 12:15:59PM -0700, ridiculous_fish wrote:
   one minor issue i still have is that in the above $COLUMNS appears to be
   evaluated only once. i'd like it to be reevaluated every time.
   
   is there a way to do that?
  Try using 'tput cols' to get the terminal width instead.
 
 oh, nice, that works, thanks!
 
 btw: $LINES is broken, it has the columns value.
 (built from http://fishshell.com/files/2.0.0/fish-2.0.0.tar.gz )

Yes, that got picked up in 
https://github.com/fish-shell/fish-shell/pull/745 and fixed as 9f0775c. 
You can try a development build, or use `tput lines` to work around it.

David Adam
zanc...@ucc.gu.uwa.edu.au--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151iu=/4140/ostg.clktrk___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] Meaning of message when exiting fish-shell with background jobs running

2013-09-18 Thread Mandeep Sandhu
If I start a program in the background mode (like ./prog ) and exit the
shell (Ctrl+D), I see the following message:

There are stopped jobs. A second attempt to exit will enforce their
termination.

If I exit again, immediately, it'll quit the shell. However, the above
message made me think that my background job will be terminated as well!

However, using 'ps' o/p I could verify that the program was running even
after exit and was re-parented to init (?), I think.

Why do we show that message and what does it really mean? I mean the
background job is _still_ running, then why the message? Or am I missing
something obvious?

thanks,
-mandeep
--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151iu=/4140/ostg.clktrk___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users