Re: [Fish-users] How to use AND/OR in scripts?

2015-08-25 Thread Maxim Gonchar
The thing to understand here is that 'and', 'or' and to some extent 'for'  
in fish are simple commands and fish doesn't track their usage in any  
particular way (like bash does). You have three choices:

1) Using begin/end to group expressions:
if begin test $i = .; or test $i = ..; end

2) Using and/or commandness:
test $i = .; if or test $i = ..


3) Using 'test' command syntax:
if test $i = . -o test $i = ..; end

regards,
Maxim

On Tue, 25 Aug 2015 08:12:14 +0300, Luciano ES lucm...@gmail.com wrote:

 Yes, I googled and looked it up in the manual, and still can't solve  
 this.

 Consider this script:

 #!/usr/bin/env fish
 function xlist
   for i in (command ls -1a)
   echo $i
   end
 end

 I run it and get 194 items including files and directories. That is  
 wrong. It should be 192. Ah, sure, it's counting . and .. so it adds  
 two. Let's fix it:

 #!/usr/bin/env fish
 function xlist
   for i in (command ls -1a)
   if test $i = .
   continue
   end
   if test $i = ..
   continue
   end
   echo $i
   end
 end

 Now I run it and get 192. Good!

 But what if I want the two conditions on one line?

 #!/usr/bin/env fish
 function xlist
   for i in (command ls -1a)
   if test $i = .; or test $i = ..
   continue
   end
   echo $i
   end
 end

 Now I get 193. The .. entry (or rather the second conditional if I  
 swap . and .. in the script) is getting through the filter.

 What am I doing wrong?


 As a side note, simple globbing (for i in *) returns the files only, not  
 any directories. Is that by design?


--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] lpr copies option

2014-02-09 Thread Maxim Gonchar
You need to escape '#' symbol as soon as it's comment mark. Use -\# 3 or  
quotes as it was suggested before.

Maxim

On Mon, 10 Feb 2014 04:41:48 +0400, Bryan Kilgallin  
br...@netspeed.com.au wrote:

 The lpr command prints files. It has a -# option that sets the
 number of copies to print.

 This option is available in BASH.

 But unfortunately FISH does not recognise it. So I get the unknown
 option error message.

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Question building recursive_replace function

2014-01-10 Thread Maxim Gonchar

Hi,it seems that you have to replace the quoting from '' to "":"s/$argv[1]/$argv[2]/g"because the variables are not expanded otherwise.regards,MaximOn Sat, 11 Jan 2014 08:24:09 +0800, benjamin adamson adamson.benja...@gmail.com wrote:Hello fish terminal team!I have a quick question about a script I am trying to build.Based on this stackoverflow question,http://stackoverflow.com/questions/1583219/awk-sed-how-to-do-a-recursive-find-replace-of-a-string

I am building the following fn:function recursive_replace set arg_count (count $argv) if [ $arg_count != 2 ]  echo "expecting two arguments."  return

 end echo replacing $argv[1] echo replacing $argv[2] find . -type f -print0 | xargs -0 sed -i 's/$argv[1]/$argv[2]/g'endHowever I feel like based on the way fish is structured, perhaps I am approaching the problem wrong. The above fn doesn't work, because $argv[1] isn't being textually replaced by it's value when the find command is executed.

Can someone suggest how I can get this to work? I'm either missing something in the documentation, or completely clueless how fish is envisioned to be used.Thanks!! :)
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Input redirection console

2013-07-09 Thread Maxim Gonchar
echo 
Hello world!
 | cat

On Tue, 09 Jul 2013 03:06:07 +0400, Alex Boisvert  
alex.boisv...@gmail.com wrote:

 What is the fish equivalent for this bash-ism?

 $ cat END
 Hello World!
 END
 Hello World!

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] bash/zsh compatibility helper?

2013-05-13 Thread Maxim Gonchar

Hi,

I have a script which is doing what you suggested:
source env.sh
source env.csh
source env.csh

If a file lacks extension you can use options --sh, --bash and --csh.
If you use --ext it works in a bit different way: it execs a foreign shell  
which sources a file and then execs fish again.


It was stable, but be careful, it can corrupt current environment if it  
fails.


regards,
Maxim

On Mon, 13 May 2013 15:52:30 +0400, Michael Stillwell m...@beebo.org  
wrote:



Is there any way to run bash/zsh scripts that set environment
variables under fish?  I was hoping there'd be a function that did
something like:

1. Run printenv under fish, capture the output.
2. Run the script under bash, capture the output of printenv.
3. Diff the two printenv outputs, and run set commands within fish as
appropriate.

The script I'm especially trying to get working with fish at the moment  
is


https://github.com/postmodern/chruby/blob/master/share/chruby/chruby.sh

but it's a somewhat general problem.




Cheers,
Michael

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

source.fish
Description: Binary data
--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] bash/zsh compatibility helper?

2013-05-13 Thread Maxim Gonchar
Steve,

thank you for the script.

Maxim

On Mon, 13 May 2013 16:47:47 +0400, Stestagg stest...@gmail.com wrote:

 Hi

 Here's an alternate version that doesn't use temporary files, but does  
 use
 python.

 Usage:

 ```
 ./source_compat.py source script file here | .
 ```

 Note, in your example, you need to source the file, and then call a
 function from that file.  This is also possible:

 ```
 ./source_compat.py 'source ./chruby.sh; chruby_use' | .
 ```

 Thanks

 Steve

 On Mon, May 13, 2013 at 1:36 PM, Maxim Gonchar gma...@gmail.com wrote:

 Hi,

 I have a script which is doing what you suggested:
 source env.sh
 source env.csh
 source env.csh

 If a file lacks extension you can use options --sh, --bash and --csh.
 If you use --ext it works in a bit different way: it execs a foreign  
 shell
 which sources a file and then execs fish again.

 It was stable, but be careful, it can corrupt current environment if it
 fails.

 regards,
 Maxim


 On Mon, 13 May 2013 15:52:30 +0400, Michael Stillwell m...@beebo.org
 wrote:

  Is there any way to run bash/zsh scripts that set environment
 variables under fish?  I was hoping there'd be a function that did
 something like:

 1. Run printenv under fish, capture the output.
 2. Run the script under bash, capture the output of printenv.
 3. Diff the two printenv outputs, and run set commands within fish as
 appropriate.

 The script I'm especially trying to get working with fish at the  
 moment is

 https://github.com/postmodern/**chruby/blob/master/share/**
 chruby/chruby.shhttps://github.com/postmodern/chruby/blob/master/share/chruby/chruby.sh

 but it's a somewhat general problem.




 Cheers,
 Michael

 --**--**
 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and
 their applications. This 200-page book is written by three acclaimed
 leaders in the field. The early access version is available now.
 Download your free book today!  
 http://p.sf.net/sfu/neotech_**d2d_mayhttp://p.sf.net/sfu/neotech_d2d_may
 __**_
 Fish-users mailing list
 Fish-users@lists.sourceforge.**net Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/**lists/listinfo/fish-usershttps://lists.sourceforge.net/lists/listinfo/fish-users



 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and
 their applications. This 200-page book is written by three acclaimed
 leaders in the field. The early access version is available now.
 Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion for aliases, a la bash

2013-01-24 Thread Maxim Gonchar
You can try this function to make completions for aliases:

   function make_completion --argument-names alias command
   echo 
   function __alias_completion_$alias
   set -l cmd (commandline -o)
   set -e cmd[1]
   complete -C\$command \$cmd\
   end
| .
   complete -c $alias -a (__alias_completion_$alias)
   end

use it as follows:
 make_completion aptin sudo apt-get install

I do not have aptitude and checked it on pacman:
 make_completion pacs 'pacman -S'
does the job.

The function creates function which calls 'complete -C' for the specified  
commandline with alias name substituted.

Maxim


On Thu, 24 Jan 2013 02:48:47 +0400, Mark Skilbeck m...@iammark.us wrote:

 Aw, yuck. Here's to a better future... *cheers*.

 On Wed, Jan 23, 2013 at 01:30:27PM -0800, ridiculous_fish wrote:
 Not yet, but it's highly desired:  
 https://github.com/fish-shell/fish-shell/issues/393


 On Jan 22, 2013, at 12:58 AM, Mark Skilbeck m...@iammark.us wrote:

  Hi, all.
 
  In bash, one can provide completions for aliased commands. For
  example, I could have:
 
 alias aptin=sudo apt-get install
 
  provide apt-get install's completions for the command aptin. Clearly
  this is a huge time-saver.
 
  Is the same possible in Fish? Please say yes!
 
  -mgsk
 
   
 --
  Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
  MVC, Windows 8 Apps, JavaScript and much more. Keep your skills  
 current
  with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
  MVPs and experts. ON SALE this month only -- learn more at:
  http://p.sf.net/sfu/learnnow-d2d
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 

 --
 Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
 MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
 with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
 MVPs and experts. ON SALE this month only -- learn more at:
 http://p.sf.net/sfu/learnnow-d2d
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] setting PATH for good

2013-01-10 Thread Maxim Gonchar
I guess the PATH is handled in a special way, so the -U key might not be  
appropriate. Just put all the commands you want to execute on a startup to  
the ~/.config/fish/config.fish

Maxim

On Thu, 10 Jan 2013 21:22:01 +0800, Tomasz Kuzma map...@sezamkowa.net  
wrote:

 Unfortunately it doesn't work for me:

 http://cl.ly/image/2n192D3b3P2E

 Wiadomość napisana przez SanskritFritz sanskritfr...@gmail.com w dniu  
 Jan 10, 2013, o godz. 2:15 PM:

 On Thu, Jan 10, 2013 at 12:29 PM, Tomasz Kuźma map...@sezamkowa.net  
 wrote:
 Hi fish-users!

 I got one small question that's causing a problem:

 Every time i launch fish (in iTerm2 in OSX 10.8.2) i have to manually  
 add
 tex to PATH (set PATH $PATH /usr/texbin)- how can i do it so it will be
 preserved between launches?

 Thanks for help!

 Hi, use set -U
 http://ridiculousfish.com/shell/user_doc/html/commands.html#set
 -U or --universal causes the specified environment variable to be
 given a universal scope. If this option is supplied, the variable will
 be shared between all the current users fish instances on the current
 computer, and will be preserved across restarts of the shell.

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] fish: Unknown command “history”

2012-12-19 Thread Maxim Gonchar
Hi Utkarsh,

You are using the old version of fish which doesn't contain the history  
builtin.
The latest fish release has this command. You can build it manually from:
https://github.com/fish-shell/fish-shell

Or look through the maillist archive. I guess someone is making latest deb  
files.

regards,
Maxim
On Wed, 19 Dec 2012 04:19:56 +0400, Utkarsh Sengar utkarsh2...@gmail.com  
wrote:

 Hello,

 Just installed fish on ubuntu 12.04, everything works like a charm except
 the history command for some weird reason.

 When I type: history, I get this error:
 fish: Unknown command “history”
 history: command not found

 It works fine with I switch back to bash. What am I doing wrong?

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Separators

2012-12-19 Thread Maxim Gonchar
Hi,

I hope so (:
we are discussing it here:  
https://github.com/fish-shell/fish-shell/issues/384

Maxim

On Wed, 19 Dec 2012 20:10:18 +0400, Goran Mekić m...@lugons.org wrote:

   Hello,
 Is there a way to configure fish to recognize the following array as
 separators: :;,.(){}[]? I mean, using ctrl+w, for example. Thanx!

 --
 LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
 Remotely access PCs and mobile devices and provide instant support
 Improve your efficiency, and focus on delivering more value-add services
 Discover what IT Professionals Know. Rescue delivers
 http://p.sf.net/sfu/logmein_12329d2d
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion of auto-suggest

2012-12-12 Thread Maxim Gonchar
Hi,

^F to complete the whole line, M-F to complete the line token by token.

Maxim

On Wed, 12 Dec 2012 11:21:07 +0400, Christian Rishøj  
christ...@rishoj.net wrote:

 Please excuse me if this has been documented somewhere – I have not been  
 able to find it.

 It's fantastic that fish suggests completions of commands as I type.  
 E.g., after typing

   ssh

 ...i see a suggestion with a hostname even before hitting TAB.

 Now, let's say that the suggestion is exactly that I want. How do I  
 complete it? Hitting TAB doesn't immediately complete the command in  
 case the command prefix is still ambiguous.

 Thank you,

 Christian



 --
 LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
 Remotely access PCs and mobile devices and provide instant support
 Improve your efficiency, and focus on delivering more value-add services
 Discover what IT Professionals Know. Rescue delivers
 http://p.sf.net/sfu/logmein_12329d2d
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] An idea, from implementing extended globbing in fish

2012-12-09 Thread Maxim Gonchar
Hi Cheer,

since you already use the additional function, it worth looking at the  
'find' command, which can do all the complicated job which can not be done  
with simple globbing.

regards,
Maxim

On Sun, 09 Dec 2012 17:43:59 +0400, Cheer Xiao xiaqq...@gmail.com wrote:

 Hi all,

 For those not acquainted with zsh: extended globbing is one of the
 many features of zsh that allows you to match files satisfying a given
 criteria in a inline manner (instead of going through a loop). For
 example, echo abc*(/) gives you all directories with names starting
 with abc in current directory, while rm .*(@) removes all symlinks
 with names starting with ., etc. It is a useful feature, but I don't
 really like the arcane syntax.

 Fish doesn't have extended globbing (which is good actually :-), so
 I'm tempted to write this:

 function filter
 set predicate $argv[1]
 for i in (seq 2 (count $argv))
 test $predicate $argv[$i]; and echo $argv[$i]
 end
 end

 So now I write echo (filter -d abc*) and rm (filter -L .*) to
 achieve the same effect as echo abc*(/) and rm .*(@) in zsh. It is
 more verbose, but the readability is considerably better; it also
 allows you to reuse the knowledge of the test builtin.

 This works fine until, of course, you start to encounter file names
 containing newlines. Try this:

 cd (mktemp -d)
 mkdir 'a
 b'
 count *
 count (filter -d *)

 Clearly, The problem stems from the fact that when fish expands the
 command substitution (filter -d *), filenames echo'ed by filter run
 together before being split on newlines to render the substituted
 words. A newline in one of the filenames is then indistinguishable
 with two filenames.

 So this leads to my proposal:

 * When evaluating a fish function, maintain an alternative output
 buffer besides stdout. The buffer is actually a dynamic-sized list
 (std::vector for C++ programmers) of strings. Introduce a new builtin
 (say put) to write to that buffer.

 * Exactly one of the two output buffers (let's call them stdout and
 altout) should be active within a function.

 * Within functions, calling put activates the altout and closes
 stdout. Each invocation of put with k arguments appends k new
 elements to altout. (The relationship between altout and stdout still
 needs some thoughts though.)

 * When command substitution is performed, it is checked which of
 stdout and altout is active (the latter is only possible for fish
 functions; external commands always have only stdout active). If
 altout is active, the elements in altout are substituted directly. If
 stdout is active, the content in stdout is split on newlines before
 being substituted (as is currently done).

 * When altout is written to when there is no enclosing command
 substitution (eg. calling put on the prompt), anything written to it
 is directed to stdout plus a newline.

 With altout I can write my filter by replacing echo with put and
 it's now newline-safe.

 Being able to output arrays of strings can be of many other uses -
 actually it enables you to write any array manipulating functions in
 an easy way.

 If the newline-in-filenames stuff sounds too invented and unlikely,
 consider why shells need real arrays instead of strings joined by
 delimiters (be it whitespace or newlines) at all. Actually, one of the
 favorite things about fish is its clean array syntax, it is a really
 nice thing. I think fish deserves the added expressive power. :)


 --
 Regards,
 Cheer Xiao

 --
 LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
 Remotely access PCs and mobile devices and provide instant support
 Improve your efficiency, and focus on delivering more value-add services
 Discover what IT Professionals Know. Rescue delivers
 http://p.sf.net/sfu/logmein_12329d2d
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] coloring special characters

2012-11-26 Thread Maxim Gonchar
Hi Leonardo,

try this:
set -U fish_color_redirection magenta

Maxim

On Mon, 26 Nov 2012 16:55:39 +0400, Leonardo Boiko leobo...@gmail.com  
wrote:

  set | grep ^fish
 → An error occurred while redirecting file 'fish'

 Ops! unlike sh, ^ is a metacharacter in fish! (So I have to learn a
 new habit and escape it.)

 I found myself wishing that this circumflex were colored differently
 than regular arguments (so that I knew, at a glance, that it wouldn't
 be sent as-is to the command).  In this fish, I notice the following
 special characters are colored cyan:

 $\*?(){}~%

 Also quotes (single and double) are yellow with their contents, hash
 is dark-red with the following comment, and ; are bright red.

 However, the following special characters are just in the plain white
 of normal, uninterpreted characters:

 ^|

 Could we get all special characters in a different color than the  
 nonspecial?

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] from bash to fish

2012-10-23 Thread Maxim Gonchar
On Tue, 23 Oct 2012 09:22:48 +0400, Philip Ganchev  
phil.ganc...@gmail.com wrote:

 You need to convert each of the Bash commands in your ~/.bashrc script
 to a Fish command, and put it in your fish initialization script.

 Instead of 'export', use 'set -U'. Instead of '[', use 'test'. Instead
 of the 'fi' keyword, use the 'end' keyword. Instead of defining
 aliases, define functions, using the 'function' built-in. Instead of
 'PS1', use 'PROMPT'.
I think it is better to use 'set -x' instead of export in fish.config.
Or at least 'set -Ux'.

regards
Maxim

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Basic history completion not working in OpenBeta_r2?

2012-09-15 Thread Maxim Gonchar
Hi,

the lates fish is here:
https://github.com/fish-shell/fish-shell.git

Did you try it?

regards,
Maxim


On Sat, 15 Sep 2012 02:24:59 +0300, Fred Alger f...@fredalger.net wrote:

 So I just discovered fishfish today, very impressed!  I've been using  
 fish for a long time and love it.

 So I installed OpenBeta_r2 via OS X homebrew, and I noticed two things:

 1. it clobbered my fish history :-(
 2. previous-command-arg completion doesn't work like I expect, i.e.,  
 like fish works for me:

 mkdir test
 cd (Alt+UpArrow)

 It shows 'test/' as a suggestion, but I expected Alt+Up to grab the last  
 arg from the last command.  The docs say it's supposed do that… but it's  
 not working for me.

 Am I missing something blindingly obvious here?  Is this something  
 that's been fixed?

 Thanks!

 --
 Fred Alger
 @_phred

--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Copying and pasting long commands

2012-08-29 Thread Maxim Gonchar
It seems that fish also puts hard new-line in the output, so the terminal  
do not reformat the buffer when resizing.
I've created a ticket for things discussed here:
https://github.com/fish-shell/fish-shell/issues/300

regards,
Maxim

On Fri, 24 Aug 2012 11:39:07 +0400, Jan Kanis jan.c...@jankanis.nl wrote:

 I personally wouldn't find it a problem if both the ellipsis and the
 newline are removed from fish's output.

 On Fri, Aug 24, 2012 at 6:36 AM, Kevin Ballard ke...@sb.org wrote:
 I'm pretty certain the shell can't prevent the ellipsis from getting  
 into the clipboard, since Terminal is copying the actual emitted text.

 In any case, I'm guessing bash doesn't bother to emit a hard newline  
 and lets the terminal's wrapping take care of it, which allows the copy  
 to work just fine, and I assume fish emits the hard newline after the  
 ellipsis. Fixing the newline isn't worthwhile in fish though because  
 you'd still have an ellipsis in your command.

 -Kevin

 On Aug 23, 2012, at 12:24 AM, Jon Clayden jon.clay...@gmail.com wrote:

 Thanks for the responses, and for the suggestions.

 Surely it would be possible, however, for the shell to ignore the  
 ellipsis/newline sequence, at the very least? Rewriting the command to  
 remove it would be better still, but perhaps that's more tricky.

 All the best,
 Jon


 On 23 Aug 2012, at 07:14, Maxim Gonchar gma...@gmail.com wrote:

 You can also bind some key to save the current commandline:
 bind \ey 'commandline | pbcopy'

 Maxim

 On Thu, 23 Aug 2012 08:12:41 +0400, Kevin Ballard ke...@sb.org  
 wrote:

 Copying  Pasting is a terminal-level thing. You can only copy the  
 actual text that's rendered on the terminal. So yes, you're going to  
 get the ellipsis/newline as well. Sadly, there's no avoiding that.

 However, you could work around this by piping text to `pbcopy`. If  
 you have a command in your command line that you want to copy, just  
 hit

 ^Aecho '^E' | pbcopy

 Unless you have single-quotes in the command, this will send the  
 whole command-line to `pbcopy`. Alternatively, if this is a command  
 you've already executed and now you want to save it, you could use  
 the `history` command, e.g.

   history | head -1 | pbcopy

 -Kevin

 On Aug 22, 2012, at 7:42 AM, Jon Clayden jon.clay...@gmail.com  
 wrote:

 Dear all,

 Before raising an issue for this I wanted to check if this behaviour
 is intended or unavoidable. It seems that when long commands are
 copied and pasted between fish instances, the inserted ellipsis
 characters and line breaks are pasted too, and interpreted. The
 practical upshot of this is that only part of the command line is
 pasted, with an ellipsis character, and then executed. This is quite
 annoying. It seems to happen in both the beta release and current
 master within Terminal.app on OS X 10.8.

 Can anyone shed any further light on this, please?

 Thanks, and all the best,
 Jon

 --
 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


 --
 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

Re: [Fish-users] Can't seem to signal a script

2012-08-28 Thread Maxim Gonchar
Strange it works for me on Arch linux.

What system do you use? Do you use the latest fish? I thought this  
thread-bug was already fixed.
Btw., is the testusr.fish job is the first? (Stupid question, but it's  
better to check).

regards,
Maxim

On Mon, 27 Aug 2012 20:36:37 +0400, Лев Долгов lev.dol...@gmail.com  
wrote:

 I should have sent the email on both addresses.

 On Mon, Aug 27, 2012 at 7:35 PM, Лев Долгов lev.dol...@gmail.com wrote:

 Nope. And I see a weird bug :(

 ~ cat  testusr.fish
 function testusr --on-event USR1
 echo Got the signal
 end
 while true
 sleep 1
 end
 ~ command fish testusr.fish 
 ~ kill -USR1 %Warning: principal_parser called off of main thread. Break
 on debug_thread_error to debug.
 ~ kill -USR1 %1Warning: job_get called off of main thread. Break on
 debug_thread_error to debug.
 ~ kill -USR1 %1
 ~

 regards,
 Leo


 On Mon, Aug 27, 2012 at 2:44 PM, Maxim Gonchar gma...@gmail.com wrote:

 If you make the following script (testusr.fish):

 --**---
 function testusr --on-event USR1
 echo Got the signal
 end
 while true
 sleep 1
 end
 --**---

 then run it as
 command fish testusr.fish 
 kill -USR1 %1

 do you see anything?

 regards,
 Maxim



 On Mon, 27 Aug 2012 15:01:37 +0400, Лев Долгов lev.dol...@gmail.com
 wrote:

  I have a following script that changes a wallpaper every 15 minutes  
 under
 xfce: http://pastie.org/4596618. I wish to make it possible to  
 interrupt
 the usual 15-minute delay and change the wallpaper at once if the  
 script
 is
 signalled SIGUSR1. I find the corresponding PID and send the signal:

  ps ax|grep change

 11437 pts/0S  0:00 /usr/bin/fish /opt/myscripts/change-**
 wallpaper2
 13580 pts/2S+ 0:00 grep change

 kill -USR1 11437


 but nothing happens. Am I doing something wrong?



--
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] Can't seem to signal a script

2012-08-27 Thread Maxim Gonchar
If you make the following script (testusr.fish):

-
function testusr --on-event USR1
 echo Got the signal
end
while true
 sleep 1
end
-

then run it as
command fish testusr.fish 
kill -USR1 %1

do you see anything?

regards,
Maxim


On Mon, 27 Aug 2012 15:01:37 +0400, Лев Долгов lev.dol...@gmail.com  
wrote:

 I have a following script that changes a wallpaper every 15 minutes under
 xfce: http://pastie.org/4596618. I wish to make it possible to interrupt
 the usual 15-minute delay and change the wallpaper at once if the script  
 is
 signalled SIGUSR1. I find the corresponding PID and send the signal:

 ps ax|grep change
 11437 pts/0S  0:00 /usr/bin/fish /opt/myscripts/change-wallpaper2
 13580 pts/2S+ 0:00 grep change
 kill -USR1 11437

 but nothing happens. Am I doing something wrong?

--
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] Copying and pasting long commands

2012-08-23 Thread Maxim Gonchar
You can also bind some key to save the current commandline:
bind \ey 'commandline | pbcopy'

Maxim

On Thu, 23 Aug 2012 08:12:41 +0400, Kevin Ballard ke...@sb.org wrote:

 Copying  Pasting is a terminal-level thing. You can only copy the  
 actual text that's rendered on the terminal. So yes, you're going to get  
 the ellipsis/newline as well. Sadly, there's no avoiding that.

 However, you could work around this by piping text to `pbcopy`. If you  
 have a command in your command line that you want to copy, just hit

 ^Aecho '^E' | pbcopy

 Unless you have single-quotes in the command, this will send the whole  
 command-line to `pbcopy`. Alternatively, if this is a command you've  
 already executed and now you want to save it, you could use the  
 `history` command, e.g.

 history | head -1 | pbcopy

 -Kevin

 On Aug 22, 2012, at 7:42 AM, Jon Clayden jon.clay...@gmail.com wrote:

 Dear all,

 Before raising an issue for this I wanted to check if this behaviour
 is intended or unavoidable. It seems that when long commands are
 copied and pasted between fish instances, the inserted ellipsis
 characters and line breaks are pasted too, and interpreted. The
 practical upshot of this is that only part of the command line is
 pasted, with an ellipsis character, and then executed. This is quite
 annoying. It seems to happen in both the beta release and current
 master within Terminal.app on OS X 10.8.

 Can anyone shed any further light on this, please?

 Thanks, and all the best,
 Jon

 --
 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

--
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] . without any args

2012-08-16 Thread Maxim Gonchar
you need to pass EOF: press Ctrl+D.

Maxim

On Fri, 17 Aug 2012 05:33:10 +0900, Peter Flood i...@whywouldwe.com  
wrote:

 Sometimes I accidentally run . (source) without any args (by pressing
 enter too soon, before up, not after), when this happens I can't get my
 prompt back with either ctrl+c or ctrl+z and end up closing the tab. Is
 there a way to get the prompt back without ending the session?

 Thx

 --
 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


Re: [Fish-users] Minimize, maximize, resizing escape sequences

2012-08-07 Thread Maxim Gonchar
Hi,

try 'command echo' instead of 'echo', should work.
Thanks for nice aliases.

Maxim


On Wed, 08 Aug 2012 05:55:44 +0900, Matthias Wiesmann  
matthias.wiesm...@gmail.com wrote:

 Hi,

 I started using fish, a really nice replacement for bash.
 One feature I was not able to reproduce using fish was docking and  
 undocking of the window.
 Basically, in bash I had the following aliases defined:

 alias dock='echo -ne \033[2t'
 alias lower='echo -ne \033[6t'
 alias raise='echo -ne \033[5t'
 alias 42x80='echo -ne \033[8;42;80t'
 alias maxh='echo -ne \033[8;0;80t'
 alias maxw='echo -ne \033[8;24;0t'

 Those aliases let me dock the terminal window, lower it, raise, and  
 change its dimensions.
 This worked with both Apple's terminal and xterm.

 Is there any way to reproduce this behaviour using Fish?

 Thanks in advance

 Cheers

 Matthias Wiesmann
 --
 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


Re: [Fish-users] nothing appropriate

2012-08-02 Thread Maxim Gonchar
Hi,

it seems that 'nothing appropriate' is the 'apropos' command output.  
Apropos is called to print command description.
It seems that new versions of apropos print error message if the command  
is not found to the stderr.

I've fixed it in https://github.com/fish-shell/fish-shell/pull/262 .
You can do it manually by changing
apropos $argv | awk
to
apropos $argv ^/dev/null | awk
in __fish_describe_command function.

Maxim


On Fri, 03 Aug 2012 06:08:42 +0900, aurelien coillet acoil...@gmail.com  
wrote:

 Hey all,

 I'm discovering fish and I really appreciate its auto-completion
 features and color and all. Yet I have one itching issue: whenever I
 want to complete a unique program name with TAB, fish gives me a
 nothing appropriate, an end of line and finish the completion.

 For example, I want to launch inkscape, so I type inksc and press
 TAB, and here is the output result:

 inkscinksc: nothing appropriate.
 inkscape

 I would expect just the completion to inkscape, as is suggested in
 grey (and it's what happens if I hit the right arrow, but it's much
 less obvious and easy than TAB).

  I don't really understand why there is nothing appropriate, since
 it finds something (unique). Is there a way I can get rid of it (or is
 it a bug?)?

 I'm running the git version of fish, on a 64 bits Archlinux system.
 fish --version returns 2.0.0.

 Thanks for your 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] bash to fish

2012-07-31 Thread Maxim Gonchar
Hi,

I remember there was a page with tips for moving from bash to fish on the  
official site.
But I can not find it now.
Anyway I recommend to read the fish documentation, because it's well  
written
and answers all of your questions. Type 'help' for it.

 source ~/.bashrc
there is no 'source' command, use '. some_file.fish' instead. But you can  
not load bash files anyway.

 # MacPorts Installer addition on 2010-03-17_at_21:13:03: adding an  
 appropriate PATH variable for use with MacPorts.
 export PATH=$PATH:/opt/local/bin:/opt/local/sbin
set -x PATH $PATH /opt/local/bin /opt/local/sbin
set - to set variable
-x  - to export it
' ' - use spaces to separate array elements instead of ':'
set --help #for details

 # bash-completion
 if [ -f /opt/local/etc/bash_completion ]; then
 . /opt/local/etc/bash_completion
 fi
you can not use bash completions. Fish has it's own and they turned on by  
default.

 export TERM=xterm-256color
set -x TERM xterm-256-color

 # If running interactively, then:
 if [ $PS1 ]; then
if status --is-interactive
#some code
end
see documentation for 'if'

 # enable color support of ls and also add handy aliases
 #if [ $TERM != dumb ]; then
if test $TERM != dumb
 #some code
end

   alias ls='ls -FG'
   alias rm='rm -i'
   alias cp='cp -i'
   alias mv='mv -i'
as far as I know aliases should work.

   #function trash { mv $@ ~/.Trash ; }
function trash
 mv $argv ~/.Trash
end

 PS1=\[\e[0;32m\]\u@monkey:\w\$ \[\e[0m\]
see the documentation for 'fish_prompt' function and the fish_prompt  
function itself 'type fish_prompt' -
it is the function which is called to print the prompt.
You will probably need to check the following functions: funced, funcsave.

Put your new configuration to the ~/.config/fish/config.fish file. It's  
loaded on startup.

 How can I convert my bash stuff to have it in fish?
I'm not familiar with that converting script. So I can propose only the  
manual way.

Maxim

--
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] Problem with MATLAB colors and fish

2012-07-29 Thread Maxim Gonchar
The general way is the following:

function matlab
   set -lx SHELL /bin/bash
   command matlab $argv 
end

Maxim

On Mon, 30 Jul 2012 05:46:07 +0900, Kevin Ballard ke...@sb.org wrote:

 Wouldn't it be simpler to just use env?

 function matlab
 env SHELL=/bin/bash matlab 
 end

 -Kevin

 On Jul 29, 2012, at 5:24 AM, Victor Hugo victorhcm...@gmail.com wrote:

 Fish user Pedro (pedro...nior [at] gmail.com) found a solution. You  
 need to put the following function on your ~/.config/fish/config.fish  
 file:

 function matlab
 set old_shell $SHELL
 set SHELL /bin/bash
 command matlab 
 set SHELL $old_shell
 end

 This function sets the default shell as bash before calling matlab.  
 After it is invoked, the function places fish as the default shell  
 again.

 []'s
 Victor Hugo

 On Sun, Jun 17, 2012 at 12:20 AM, Victor Hugo victorhcm...@gmail.com  
 wrote:
 I have the same problem of Phil:

 This is probably silly, but I have issues with Matlab color control
 sequences when my default shell is Fish that I do not have when it is
 Bash.
 Matlab ls
 =1B=1B[00m=1B[01;34m280=1B[00m/
 =1B[35mjim-mail.txt=1B[00=
 m
 =1B[01;34mactivism=1B[00m/  =1B[00mkddresearch.org  
 ML.URL=1B[00=
 m
 A screenshot is attached.  A The listing should be:
 Matlab ls
 =1B280/ =1Bjim-mail.txt=1B
 =1Bactivism/kddresearch.org ML.URL=1B

 Is there a way to solve it?

 []'s
 Victor Hugo

 --
 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


Re: [Fish-users] Use functions with (e.g.) xargs

2012-07-24 Thread Maxim Gonchar
Hi,

the clean_file executable is not found.
What is clean_file? Does `which clean_file` prints something?
As for the syntax, I guess you can use the following instead:

clean_file (find Classes -name '*.m' -print0)

regards,
Maxim

On Tue, 24 Jul 2012 21:38:35 +0900, Eloy Durán eloy.de.en...@gmail.com  
wrote:

 Hi,

 I have a function that operates on one file. Now I have a list of files,  
 for instance from `find`, which I would all like to pass to this  
 function one by one. In my naive attempt I did the following:

   find Classes -name '*.m' -print0 | xargs -0 clean_file

 For which I get the error: “clean_file: No such file or directory”.  
 (Same goes for using `find -exec`.)

 I’m sure I’m using incorrect syntax, I’ve also tried adding parentheses  
 around the function name, but I’m just trying things by now. Can someone  
 show the way?

 Cheers,
 Eloy
 --
 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


Re: [Fish-users] Use functions with (e.g.) xargs

2012-07-24 Thread Maxim Gonchar
then you definitely can not use xargs, since it can run only executables.
But the method I proposed should work.

Maxim

On Tue, 24 Jul 2012 21:44:08 +0900, Eloy Durán eloy.de.en...@gmail.com  
wrote:

 Sorry for not being clear enough, in this example `clean_file` is my  
 function.

 On Jul 24, 2012, at 2:42 PM, Maxim Gonchar gma...@gmail.com wrote:

 Hi,

 the clean_file executable is not found.
 What is clean_file? Does `which clean_file` prints something?
 As for the syntax, I guess you can use the following instead:

 clean_file (find Classes -name '*.m' -print0)

 regards,
 Maxim

 On Tue, 24 Jul 2012 21:38:35 +0900, Eloy Durán  
 eloy.de.en...@gmail.com wrote:

 Hi,

 I have a function that operates on one file. Now I have a list of  
 files, for instance from `find`, which I would all like to pass to  
 this function one by one. In my naive attempt I did the following:

  find Classes -name '*.m' -print0 | xargs -0 clean_file

 For which I get the error: “clean_file: No such file or directory”.  
 (Same goes for using `find -exec`.)

 I’m sure I’m using incorrect syntax, I’ve also tried adding  
 parentheses around the function name, but I’m just trying things by  
 now. Can someone show the way?

 Cheers,
 Eloy
 --
 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

--
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] Use functions with (e.g.) xargs

2012-07-24 Thread Maxim Gonchar
 Yes it does work, but I was more interested in the how, in general, not  
 specifically this example.
 I'm not sure what do you mean? The general way is the following (if I  
 understand you):

 command arguments (subcommand1 subarguments1) (subcommand2  
 subarguments2) ...

 Each line of the '()' output is passed as separate argument. It seems  
 for me to be a quite a general way.
I just have noticed that you wanted to use the fish function, but not to  
pass arguments. Sorry for the misunderstanding.
In this case writing a script is the main option.

 regards,
 Maxim


 Thanks for your time!

 On Jul 24, 2012, at 3:37 PM, Maxim Gonchar gma...@gmail.com wrote:

 then you definitely can not use xargs, since it can run only  
 executables.
 But the method I proposed should work.

 Maxim

 On Tue, 24 Jul 2012 21:44:08 +0900, Eloy Durán  
 eloy.de.en...@gmail.com wrote:

 Sorry for not being clear enough, in this example `clean_file` is my  
 function.

 On Jul 24, 2012, at 2:42 PM, Maxim Gonchar gma...@gmail.com wrote:

 Hi,

 the clean_file executable is not found.
 What is clean_file? Does `which clean_file` prints something?
 As for the syntax, I guess you can use the following instead:

 clean_file (find Classes -name '*.m' -print0)

 regards,
 Maxim

 On Tue, 24 Jul 2012 21:38:35 +0900, Eloy Durán  
 eloy.de.en...@gmail.com wrote:

 Hi,

 I have a function that operates on one file. Now I have a list of  
 files, for instance from `find`, which I would all like to pass to  
 this function one by one. In my naive attempt I did the following:

 find Classes -name '*.m' -print0 | xargs -0 clean_file

 For which I get the error: “clean_file: No such file or directory”.  
 (Same goes for using `find -exec`.)

 I’m sure I’m using incorrect syntax, I’ve also tried adding  
 parentheses around the function name, but I’m just trying things by  
 now. Can someone show the way?

 Cheers,
 Eloy
 --
 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


 --
 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


Re: [Fish-users] Amphersand background statement

2012-07-22 Thread Maxim Gonchar
I don't know. It's bette to ask ridiculousfish about it.

Maxim

On Mon, 23 Jul 2012 01:33:13 +0800, Jan Kanis j...@jankanis.nl wrote:

 But now that fish is multithreaded, it's perhaps possible to execute
 background functions in a separate thread? Or is the main
 function-executing part of the new fish not multithreaded?

 On Sat, Jul 21, 2012 at 4:13 AM, Maxim Gonchar gma...@gmail.com wrote:

 Hi,

 As far as I understand, since fish do not use subshells, but executes
 functions in the same thread,
 it can not run functions in the background.
 I do not know, if there exist is a simple way to implement background
 functions.

 A partial workaround is to run a new fish instance to simulate a real
 subshell:
 fish -c 'q 10s'
 fish -c 'q 3s' 

 Of course this way is a bit limiting: the subfish will 'see' only  
 exported
 and universal variables and only saved functions.

 Maxim

 On Sat, 21 Jul 2012 08:48:21 +0800, Steven Hum sdot...@gmail.com  
 wrote:

  Yeah, it is weird. A better (?) function illustrating the problem is
 
  function q; echo $argv;sleep $argv;echo $argv;end
  q 10s; q 3s;q 6s
  10s
  10s
  3s
  3s
  6s
  6s
  Job 3, “q 6s” has ended
  Job 2, “q 3s” has ended
  Job 1, “q 10s” has ended
 
  The sequence should be job 2,3,1, yet the function calls are completed
  in sequence (with observed delays) 10s, 3s and 6s rather than yielding
 
  10s
  3s
  6s
  3s
  6s
  10s
 
  Using .. ;and ... ;and ...  to join statements would still only
  process the last command in background and not the block of commands -
  yielding results similar to above.
 
  Steven
  --
  On Fri, 20 Jul 2012 at 03:15pm, Philip Ganchev wrote:
 
  On Fri, Jul 20, 2012 at 10:51 AM, Steven Hum sdot...@gmail.com  
 wrote:
   I posted this in the github issues and don't mean to double post,  
 but
  if
   ...statement... is intended only to work for simple commands,  
 e.g.
  
   sleep 10s; sleep 3s; sleep 6s
  
   (silly example, I know!) then I can close the ticket as this may  
 not
  be a bug
   by design.
  
   What I found was, for functions, e.g.
  
   function q; echo $argv; sleep 10s; echo $argv; end
  
   and execute
  
   q 1 ; q 2 ; q 3 
  
   the output is
  
   1
   1
   2
   2
   3
   3
   Job 3, “q 3 ” has ended
   Job 2, “q 2 ” has ended
   Job 1, “q 1 ” has ended
  [...]
 
  This is very surprising to me. I'm curious about the rationale here.  
 I
  would expect the output:
 
  1
  2
  3
  1
  Job 1, “q 1 ” has ended
  2
  Job 2, “q 2 ” has ended
  3
  Job 3, “q 3 ” has ended
 
   If there is a correct fish way of spawning background function
  processes, my
   second question is: is there a way to spawn a block of commands in
  background
   similar to POSIX (command1  command2  command3...) . I tried
  begin;
   ...statements...; end  but fish does not like that either (not
  surprisingly
   given the above!)
 
  command1; and command2; and command3
 
  [...]
 
 
 
 --
  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

--
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] Amphersand background statement

2012-07-20 Thread Maxim Gonchar
Hi,

As far as I understand, since fish do not use subshells, but executes  
functions in the same thread,
it can not run functions in the background.
I do not know, if there exist is a simple way to implement background  
functions.

A partial workaround is to run a new fish instance to simulate a real  
subshell:
fish -c 'q 10s'
fish -c 'q 3s' 

Of course this way is a bit limiting: the subfish will 'see' only exported  
and universal variables and only saved functions.

Maxim

On Sat, 21 Jul 2012 08:48:21 +0800, Steven Hum sdot...@gmail.com wrote:

 Yeah, it is weird. A better (?) function illustrating the problem is

 function q; echo $argv;sleep $argv;echo $argv;end
 q 10s; q 3s;q 6s
 10s
 10s
 3s
 3s
 6s
 6s
 Job 3, “q 6s” has ended
 Job 2, “q 3s” has ended
 Job 1, “q 10s” has ended

 The sequence should be job 2,3,1, yet the function calls are completed
 in sequence (with observed delays) 10s, 3s and 6s rather than yielding

 10s
 3s
 6s
 3s
 6s
 10s

 Using .. ;and ... ;and ...  to join statements would still only
 process the last command in background and not the block of commands -
 yielding results similar to above.

 Steven
 --
 On Fri, 20 Jul 2012 at 03:15pm, Philip Ganchev wrote:

 On Fri, Jul 20, 2012 at 10:51 AM, Steven Hum sdot...@gmail.com wrote:
  I posted this in the github issues and don't mean to double post, but  
 if
  ...statement... is intended only to work for simple commands, e.g.
 
  sleep 10s; sleep 3s; sleep 6s
 
  (silly example, I know!) then I can close the ticket as this may not  
 be a bug
  by design.
 
  What I found was, for functions, e.g.
 
  function q; echo $argv; sleep 10s; echo $argv; end
 
  and execute
 
  q 1 ; q 2 ; q 3 
 
  the output is
 
  1
  1
  2
  2
  3
  3
  Job 3, “q 3 ” has ended
  Job 2, “q 2 ” has ended
  Job 1, “q 1 ” has ended
 [...]

 This is very surprising to me. I'm curious about the rationale here. I
 would expect the output:

 1
 2
 3
 1
 Job 1, “q 1 ” has ended
 2
 Job 2, “q 2 ” has ended
 3
 Job 3, “q 3 ” has ended

  If there is a correct fish way of spawning background function  
 processes, my
  second question is: is there a way to spawn a block of commands in  
 background
  similar to POSIX (command1  command2  command3...) . I tried  
 begin;
  ...statements...; end  but fish does not like that either (not  
 surprisingly
  given the above!)

 command1; and command2; and command3

 [...]


 --
 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


Re: [Fish-users] vi-mode WIP

2012-06-28 Thread Maxim Gonchar
Hi,

I've found that '\e' binding (which represents ESC) breaks all other '\eX'  
bindings, which is quite sad.
Is it a supposed behavior?

Maxim

On Tue, 26 Jun 2012 15:32:59 +0800, Ian Munsie darkstarsw...@gmail.com  
wrote:

 On Tue, Jun 26, 2012 at 5:27 PM, Maxim Gonchar gma...@gmail.com wrote:
 It works. By the way, fish prompt is not updated when editing functions  
 or
 entering text to read function.

 /me runs funced for the first time

 o_O

 ooh... shiny :)

--
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] vi-mode WIP

2012-06-28 Thread Maxim Gonchar
Hi,

Please, add __vi_mode_user call for __vi_mode_g. And other future modes if  
they suit.

Maxim

On Thu, 28 Jun 2012 14:27:22 +0800, Maxim Gonchar gma...@gmail.com wrote:

 Hi,

 I've found that '\e' binding (which represents ESC) breaks all other  
 '\eX' bindings, which is quite sad.
 Is it a supposed behavior?

 Maxim

 On Tue, 26 Jun 2012 15:32:59 +0800, Ian Munsie darkstarsw...@gmail.com  
 wrote:

 On Tue, Jun 26, 2012 at 5:27 PM, Maxim Gonchar gma...@gmail.com wrote:
 It works. By the way, fish prompt is not updated when editing  
 functions or
 entering text to read function.

 /me runs funced for the first time

 o_O

 ooh... shiny :)

--
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] vi-mode WIP

2012-06-28 Thread Maxim Gonchar
One more problem: motion commands cause error when commandline is empty.

 They seem to work for me - I can still do alt+b/f, etc in insert mode.
Strange. alt+b/f works for me either.

but if i 'bind \ee echo 123 it doesn't work.

Can you try?

Maxim


 Can you give me a concrete example of what is failing for you + what
 environment you are using (terminal emulator  distro) that I can try?

 There are a few different ways that terminals can handle
 escape/alt/meta which might be causing some issues here. For reference
 I'm using xterm with Meta Sends Escape enabled (control-left click
 on xterm to find this setting - I set it in ~/.Xresources). I would
 tell you what other relevant settings I'm using, but I'm not entirely
 sure how to check (they should be whatever the defaults are in Debian
 testing except for metaSendsEscape and some other less relevant
 settings )...

 Cheers,
 -Ian

 --
 http://sites.google.com/site/DarkStarJunkSpace
 --
 http://darkstarshout.blogspot.com/
 --
 On the day *I* go to work for Microsoft, faint oinking sounds will be
 heard from far overhead, the moon will not merely turn blue but
 develop polkadots, and hell will freeze over so solid the brimstone
 will go superconductive.
     -- Eric S. Raymond, 2005
 --
 Please avoid sending me Word or PowerPoint attachments.
 See http://www.gnu.org/philosophy/no-word-attachments.html

--
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] vi-mode WIP

2012-06-28 Thread Maxim Gonchar
Hi,

in normal/multiline mode I,^,_ keys cause cursor to go to the very first  
line, instead of current.

Maxim


On Tue, 26 Jun 2012 14:59:02 +0800, Ian Munsie darkstarsw...@gmail.com  
wrote:

 j/k - to go up/down when editing multiline?

 I want that behaviour as well - just need to figure out how to get it  
 to work
 properly with history.

 I just discovered the up/down-or-search functions, which are already
 pretty close to what I wanted for this. I've changed j  k to use them
 - let me know how you find the new behaviour.

 Cheers,
 -Ian

--
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] vi-mode WIP

2012-06-28 Thread Maxim Gonchar
Hi,

right, I've missed it. Now it works. Your script now incompatible with  
python3.
In order to fix it, you need to add the following line:
 from functools import reduce

This also works for python2, so it doesn't break anything.

regards,
Maxim

On Fri, 29 Jun 2012 08:52:29 +0800, Ian Munsie darkstarsw...@gmail.com  
wrote:

 On Thu, Jun 28, 2012 at 10:07 PM, Maxim Gonchar gma...@gmail.com wrote:
 Hi,

 in normal/multiline mode I,^,_ keys cause cursor to go to the very first
 line, instead of current.

 I already pushed a fix for that on Wednesday - can you check that you
 are running the latest version?

 Cheers,
 -Ian

--
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] Suggestion: Functions depending on hostname

2012-06-27 Thread Maxim Gonchar
If there are a several functions for common hosts, you can also add  
different paths to fish_function_path
in your config.fish and place functions there:

switch (hostname)
 case host1
set fish_function_path $fish_function_path /path/to/host1/functions
 case host2
set fish_function_path $fish_function_path /path/to/host2/functions
 case 'host_*'
set fish_function_path $fish_function_path /path/to/host_N/functions
end

Maxim


On Wed, 27 Jun 2012 11:30:28 +0400, Christopher Wright  
dhase...@gmail.com wrote:

 Try this pattern:

 # .config/fish/functions/mybox.fish
 function mybox
   ssh mybox.example.com $argv
 end

 # .config/fish/config.fish
 if test (hostname) == mybox
   functions -e mybox
 end

 ...except for `functions -e` not working yet (at least for me; am I on  
 master?).

 Quoting Elis Axelsson (2012-06-26 09:37:27)
 Hello fishermans ;)

 In my case, I have a repo for my home-folder. Which I have on almost
 all my boxes to keep my configs synced. I also like to make aliases
 for ssh to some different boxes, so I just type the name of the box in
 my fish and I get there.

 And It's very very rare that I want to ssh to localhost, so I fired up
 a texteditor and added if-statements depending on hostname to make a
 function or not in my ~/.config/fish/function/*fish files... like
 this:
 if test (hostname) != mybox
function mybox
ssh mybox.example.com $argv
end
 end

 This works well, until I want to funced that function on any box, I
 have to do it by hand in the file. The inline-editor does not do it
 for me if I have if-statement outside of the function-declaration. But
 that's fine.

 So to my suggestion:

 To introduce --hosts on function

 And that you can have multiple hosts separated by comma and that you
 can have wildcard * for any host, and have like !myhost42 to say
 don't make this function available on hosts with the name myhost42

 Like this:

 function mybox --hosts *,!mybox
  ssh mybox.example.com $argv
 end

 --
 Elis etu Axelsson

 --
 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

--
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] Suggestion: Functions depending on hostname

2012-06-27 Thread Maxim Gonchar
Are not you supposed to give exact function name to 'functions -e'?

Maxim

On Wed, 27 Jun 2012 11:36:02 +0400, Kevin Ballard ke...@sb.org wrote:

 `functions -e` works just fine for me. But may I make one minor tweak:

 # .config/fish/config.fish
 functions -e (hostname)

 -Kevin

 On Jun 27, 2012, at 12:30 AM, Christopher Wright dhase...@gmail.com  
 wrote:

 Try this pattern:

 # .config/fish/functions/mybox.fish
 function mybox
  ssh mybox.example.com $argv
 end

 # .config/fish/config.fish
 if test (hostname) == mybox
  functions -e mybox
 end

 ...except for `functions -e` not working yet (at least for me; am I on  
 master?).

 Quoting Elis Axelsson (2012-06-26 09:37:27)
 Hello fishermans ;)

 In my case, I have a repo for my home-folder. Which I have on almost
 all my boxes to keep my configs synced. I also like to make aliases
 for ssh to some different boxes, so I just type the name of the box in
 my fish and I get there.

 And It's very very rare that I want to ssh to localhost, so I fired up
 a texteditor and added if-statements depending on hostname to make a
 function or not in my ~/.config/fish/function/*fish files... like
 this:
 if test (hostname) != mybox
   function mybox
   ssh mybox.example.com $argv
   end
 end

 This works well, until I want to funced that function on any box, I
 have to do it by hand in the file. The inline-editor does not do it
 for me if I have if-statement outside of the function-declaration. But
 that's fine.

 So to my suggestion:

 To introduce --hosts on function

 And that you can have multiple hosts separated by comma and that you
 can have wildcard * for any host, and have like !myhost42 to say
 don't make this function available on hosts with the name myhost42

 Like this:

 function mybox --hosts *,!mybox
 ssh mybox.example.com $argv
 end

 --
 Elis etu Axelsson

 --
 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


 --
 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


Re: [Fish-users] vi-mode WIP

2012-06-26 Thread Maxim Gonchar
It works. By the way, fish prompt is not updated when editing functions or  
entering text to read function.
When editing long functions, prompt sometimes is not on the screen.
This is rather fish issue, for now I can not imagine any way to deal with  
it.

regards,
Maxim

On Tue, 26 Jun 2012 10:59:02 +0400, Ian Munsie darkstarsw...@gmail.com  
wrote:

 j/k - to go up/down when editing multiline?

 I want that behaviour as well - just need to figure out how to get it  
 to work
 properly with history.

 I just discovered the up/down-or-search functions, which are already
 pretty close to what I wanted for this. I've changed j  k to use them
 - let me know how you find the new behaviour.

 Cheers,
 -Ian

--
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] vi-mode WIP

2012-06-25 Thread Maxim Gonchar
Hi Ian,

 - I changed 'functions -e vi_mode_user' to 'functions -q' - I assume
 that is what you meant.
Sure. Funny typo.

 The idea here being to distinguish between functions/variables that we
 expect a user to access (prefixed with vi_mode_) vs. internal only
 functions (prefixed with __vi_mode_). What is your take on this
 matter?
I never saw this documented. But I agree with you. Usually I prefix  
functions which are not to be run manually.

 I'd certainly appreciate any further feedback you have :)
Sure I will have. Working in vi mode is like a breath of fresh air (:

By the way, are you going to implement also:
^ - first non-space character
j/k - to go up/down when editing multiline?

When I start new fish and try to use undo, fish inserts the copy of  
current commandline instead of the right part of the commandline and  
prints the number of characters before the cursor.

After that undo works ok.

regards,
Maxim

--
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] vi-mode WIP

2012-06-25 Thread Maxim Gonchar
Btw, I think it worth requesting the binding presets, so there were no  
need to rebind keys every time.
I mean something like commands:
bind --preset normal
bind --preset insert
To quickly save load presets.

Other useful option that can be requested is to 'catch the next symbol'  
option, which will be useful for operators and replace modes.

Maxim

On Mon, 25 Jun 2012 12:48:55 +0400, Ian Munsie darkstarsw...@gmail.com  
wrote:

 On Mon, Jun 25, 2012 at 4:40 PM, Maxim Gonchar gma...@gmail.com wrote:
 By the way, are you going to implement also:
 ^ - first non-space character

 Huh, I always thought that was what _ did. But, yes I will implement  
 that.

 I've just pushed a change implementing ^

 Cheers,
 -Ian

--
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] vi-mode WIP

2012-06-24 Thread Maxim Gonchar
Hi Ian,

thank you very much for you script. On this stage I already can use it  
full time.

I have some notes and remarks:

1) I would propose to call 'print( args )' instead of 'print args' for  
python in order your script worked on systems with python3 as default  
python.

2) You can set items for vi_mode variable configurable, so one could set a  
color for it.

3) You could also support user keybindings by calling 'vi_mode_user mode'  
(if defined) so users can have their additional bindings set by defining  
vi_mode_user function.

4) I think it is not a good idea to make shortnamed commands like  
overwrite, replace, etc. Because it's that possible users can have them  
defined for the interactive usage. I propose to prefix all the internal  
commands by '__vi_mode_' in order to avoid ambiguity.

regards,
Maxim

On Fri, 22 Jun 2012 13:45:15 +0400, Ian Munsie darkstarsw...@gmail.com  
wrote:

 Hi Everyone,

 For those interested, I've just pushed a new version of these bindings.

 Now with 1000% more embedded python :-P



 IMPORTANT: This now relies on the version of fish in the master
 branch, so make sure you are running that before trying this
 (otherwise using any direction could cause the command line to
 change).



 The major new feature is support for directions and some commands to
 use them - commands like dW (delete to end of WORD), cb (change to
 start of word), and so on should now do as vim users expect :)

 Currently only the c and d commands can use directions (and obviously
 directions without a command move the cursor), but I've made it
 generic enough that it should be fairly easy to add more (the g~
 family of commands come to mind). If anyone has any particular
 commands they can't live without let me know and I'll try to
 prioritise them :)


 The regular expressions I used for the w, e and b directions aren't
 quite perfect, but editing them was doing my head in and they seem
 close enough to me. Improvements welcome :)


 Other minor improvements include:
 - The w and e commands should now place the cursor at the correct
 position instead of on the space :)
 - The cursor should now be positioned correctly in more cases (e.g.
 when leaving insert or overwrite modes)


 The next features on my TODO list are to implement the f, F, t and T
 directions (which should be fairly trivial, but I ran out of time
 today). If I've missed any other directions/commands that people need
 please let me know.


 Cheers,
 -Ian

--
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] vi-mode WIP

2012-06-24 Thread Maxim Gonchar

Hi,

I've updated python's 'print', added colors for mode indicators and added  
calling vi_mode_user in the end of

functions, which set vi_mode. You can check the code in the attached file.

By the way, prefixing functions with the same prefix will simplify  
splitting the vi-mode.fish in separate files and adding it to the fish.


Maxim

On Mon, 25 Jun 2012 06:02:28 +0400, Maxim Gonchar gma...@gmail.com wrote:


Hi Ian,

thank you very much for you script. On this stage I already can use it  
full time.


I have some notes and remarks:

1) I would propose to call 'print( args )' instead of 'print args' for  
python in order your script worked on systems with python3 as default  
python.


2) You can set items for vi_mode variable configurable, so one could set  
a color for it.


3) You could also support user keybindings by calling 'vi_mode_user  
mode' (if defined) so users can have their additional bindings set by  
defining vi_mode_user function.


4) I think it is not a good idea to make shortnamed commands like  
overwrite, replace, etc. Because it's that possible users can have them  
defined for the interactive usage. I propose to prefix all the internal  
commands by '__vi_mode_' in order to avoid ambiguity.


regards,
Maxim

On Fri, 22 Jun 2012 13:45:15 +0400, Ian Munsie darkstarsw...@gmail.com  
wrote:



Hi Everyone,

For those interested, I've just pushed a new version of these bindings.

Now with 1000% more embedded python :-P



IMPORTANT: This now relies on the version of fish in the master
branch, so make sure you are running that before trying this
(otherwise using any direction could cause the command line to
change).



The major new feature is support for directions and some commands to
use them - commands like dW (delete to end of WORD), cb (change to
start of word), and so on should now do as vim users expect :)

Currently only the c and d commands can use directions (and obviously
directions without a command move the cursor), but I've made it
generic enough that it should be fairly easy to add more (the g~
family of commands come to mind). If anyone has any particular
commands they can't live without let me know and I'll try to
prioritise them :)


The regular expressions I used for the w, e and b directions aren't
quite perfect, but editing them was doing my head in and they seem
close enough to me. Improvements welcome :)


Other minor improvements include:
- The w and e commands should now place the cursor at the correct
position instead of on the space :)
- The cursor should now be positioned correctly in more cases (e.g.
when leaving insert or overwrite modes)


The next features on my TODO list are to implement the f, F, t and T
directions (which should be fairly trivial, but I ran out of time
today). If I've missed any other directions/commands that people need
please let me know.


Cheers,
-Ian

vi-mode.fish
Description: Binary data
--
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] sourcing bash/tcsh files in fish

2012-06-14 Thread Maxim Gonchar

Hi,

I've got a function, which allows to source bash/tcsh source files from  
within fish.

All it can do is to update exported variables.
In normal mode it runs the foreign shell, sources the file, makes the  
'diff' of

'env' output and updates the changed variables in fish.

It can be used in the following way:
source file.sh
source file.csh
or
source file.tcsh

If file has no extension, one should specify the file format manually
source --sh sourcefile
source --csh sourcefile
source --bash sourcefile

There is also another mode, triggered by --ext option:
source --ext sourcefile.sh
Instead of making 'diff' of the exported environment, it makes 'exec sh'
to start the foreign shell, sources the file, and 'exec fish' to get the  
fish
again with new exported variables. When this method is used, all local  
variables and

unsaved functions are lost. So it's less preferable.

Concerning the keychain example. If it outputs the code to be sourced, it  
can be used in the following way:

source --sh (keychain --eval id_rsa 52B5C810 | psub)

See the function in the attachments.

regards,
Maxim


On Wed, 13 Jun 2012 13:08:32 +0400, pants pa...@cs.hmc.edu wrote:


keychain does not actually run the set commands.  All it does is print
those strings to stout.  You need to either set up something to eval
each of them or parse them and run set on each of their arguments.  As
it is set up right now in your config.fish, you are simply echoing the
strings and not evaluating them.

pants.

On Wed, Jun 13, 2012 at 10:55:40AM +0200, Gour wrote:

Hello!

In my zsh setup I use keychain to start ssg  gpg agents automatically,
but have problems using it under fish.

I put the following in my config.fish:

keychain --eval id_rsa 52B5C810

set fish as default shell and upon launching XFCE I get dialogs to
enter passwords.

Moreover, keychain lists the running agents:


gour@atmarama ~ keychain --agents

 * keychain 2.7.1 ~ http://www.funtoo.org
 * Found existing ssh-agent: 4212
 * Found existing gpg-agent: 4238

However, the problem is that trying to ssh to some remote server, I'm
asked for a passphrase.

Here is the ps ax output:

gour@atmarama ~ ps ax | grep ssh
 4212 ?Ss 0:00 ssh-agent
 4413 ?Ss 0:00 /usr/bin/gpg-agent --sh --daemon
 --enable-ssh-support --write-env-file /home/gour/.cache/gpg-agent-info

Moreover, ssh does not report any identity:

gour@atmarama ~ ssh-add -l
The agent has no identities.

My ~/.keychain/domain-fish has the following content:

set -e SSH_AUTH_SOCK; and set -x -U
SSH_AUTH_SOCK /tmp/ssh-0F3yvROn3IrT/agent.4211 set -e SSH_AGENT_PID;
and set -x -U SSH_AGENT_PID 4212

but, as seen, above, ssh-add shows no identity.

Here  is ~/.keychain/domain-sh output:

SSH_AUTH_SOCK=/tmp/ssh-0F3yvROn3IrT/agent.4211; export SSH_AUTH_SOCK;
SSH_AGENT_PID=4212; export SSH_AGENT_PID;

If I logout/login with zsh as default shell, the same agents are
still running and ssh-add -l shows my RSA identity and I can log to the
remote server without typing password.

Any clue what's wrong?


Sincerely,
Gour

--
Even a man of knowledge acts according to his own nature, for
everyone follows the nature he has acquired from the three modes.
What can repression accomplish?

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810





--
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

source.fish
Description: Binary data
--
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

[Fish-users] sourcing bash/csh files in fish

2012-06-14 Thread Maxim Gonchar

Hi,

(this is a copy, without 'Re:' tag, so everybody interested can get it)

I've got a function, which allows to source bash/tcsh source files from  
within fish.

All it can do is to update exported variables.
In normal mode it runs the foreign shell, sources the file, makes the  
'diff' of

'env' output and updates the changed variables in fish.

It can be used in the following way:
source file.sh
source file.csh
or
source file.tcsh

If file has no extension, one should specify the file format manually
source --sh sourcefile
source --csh sourcefile
source --bash sourcefile

There is also another mode, triggered by --ext option:
source --ext sourcefile.sh
Instead of making 'diff' of the exported environment, it makes 'exec sh'
to start the foreign shell, sources the file, and 'exec fish' to get the  
fish
again with new exported variables. When this method is used, all local  
variables and

unsaved functions are lost. So it's less preferable.

Concerning the keychain example. If it outputs the code to be sourced, it  
can be used in the following way:

source --sh (keychain --eval id_rsa 52B5C810 | psub)

See the function in the attachments.

regards,
Maxim

source.fish
Description: Binary data
--
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] VIM Colour Problems

2012-06-07 Thread Maxim Gonchar
 Could you try:
 $ echo $TERM

 in fish, and you can do...
 $ set -g TERM xterm-256color

 in ~/.config/fish/config.fish
set -gx TERM xterm-256color

Maxim

--
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] git question

2012-06-06 Thread Maxim Gonchar
Well, the same happens after updates of original repository.
If I try 'git log' I see only old commits that happen more than a week ago.

After reading some forums, I've tried to set upstream
git remote add upstream  
https://git.gitorious.org/~ridiculousfish/fish-shell/fishfish.git
and then
git merge --ff-only upstream/master
or
git pull --all

But again, I do not have latest commits.

Maxim

On Wed, 06 Jun 2012 02:57:04 +0400, Jan Kanis jan.c...@jankanis.nl wrote:

 That means your local git repo has everything from fishfish already in  
 it.
 After that try pushing those changes to your maxfl repo:
 $ git push g...@gitorious.org:~maxfl/fish-shell/maxfl-fishfish.git


 On Tue, Jun 5, 2012 at 2:07 PM, Maxim Gonchar gma...@gmail.com wrote:

 Yes, I've tried it.

 Here is the output.

 git pull https://git.gitorious.org/~**ridiculousfish/fish-shell/**
 fishfish.githttps://git.gitorious.org/%7Eridiculousfish/fish-shell/fishfish.git

 From  
 https://git.gitorious.org/~**ridiculousfish/fish-shell/**fishfishhttps://git.gitorious.org/%7Eridiculousfish/fish-shell/fishfish
  * branchHEAD   - FETCH_HEAD
 Already up-to-date.

 It does nothing. Probably the point is that non-master branch is used.
 Is there a way to specify which branch to pull?

 Maxim


 On Tue, 05 Jun 2012 15:48:28 +0400, Jan Kanis jan.c...@jankanis.nl
 wrote:

  I'm not a git expert, but the idea would be to git pull  
 ridiculousfish's
 changes to your local repo, and the git push them to your maxfl repo.  
 The
 push is probably something like git push
 g...@gitorious.org:~maxfl/fish-**shell/maxfl-fishfish.git
 master. You can find the exact push url on the gitorious page of your
 repo, and also instructions on how to push/pull it.

 On Tue, Jun 5, 2012 at 12:24 PM, Maxim Gonchar gma...@gmail.com  
 wrote:

  Hi,

 I've a question to the git experts.
 On the gitorious I've cloned ridiculous/fish-shell/fishfish  
 repository to
 my account maxfl/fish-shell/maxfl-**fishfish.
 Then I've cloned the remote clone of ridiculous/fish-shell on my local
 computer.
 In this situation 'git pull' command updates the local repository from
 the
 remote one. But how can I get the latest ridiculous/fish-shell commits
 to be in maxfl/fish-shell/maxfl-**fishfish?

 thanks in advance.

 Maxim


 --**--**
 --
 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/http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 __**_
 Fish-users mailing list
 Fish-users@lists.sourceforge.**net Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/**lists/listinfo/fish-usershttps://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


Re: [Fish-users] git question

2012-06-06 Thread Maxim Gonchar
Yes. I'm being paranoid about this point and check the branch after every  
failure.

Maxim

On Wed, 06 Jun 2012 11:47:52 +0400, SanskritFritz  
sanskritfr...@gmail.com wrote:

 On Wed, Jun 6, 2012 at 8:07 AM, Maxim Gonchar gma...@gmail.com wrote:

 Well, the same happens after updates of original repository.
 If I try 'git log' I see only old commits that happen more than a week  
 ago.

 After reading some forums, I've tried to set upstream
 git remote add upstream
 https://git.gitorious.org/~ridiculousfish/fish-shell/fishfish.git
 and then
 git merge --ff-only upstream/master
 or
 git pull --all

 But again, I do not have latest commits.


 Silly question, did you switch to fish_fish the branch?

--
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] git question

2012-06-05 Thread Maxim Gonchar
Hi,

I've a question to the git experts.
On the gitorious I've cloned ridiculous/fish-shell/fishfish repository to  
my account maxfl/fish-shell/maxfl-fishfish.
Then I've cloned the remote clone of ridiculous/fish-shell on my local  
computer.
In this situation 'git pull' command updates the local repository from the  
remote one. But how can I get the latest ridiculous/fish-shell commits
to be in maxfl/fish-shell/maxfl-fishfish?

thanks in advance.

Maxim

--
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] fishfish: history search and history token search

2012-06-04 Thread Maxim Gonchar
Hi,

It seems that history search by Up/Down when command part is written isn't  
colored anymore. Changing fish_color_search_match doesn't help.

The token search (AltUp, AltDown, history-token-search-forward/backward)  
doesn't work anymore.

By the way, I use urxvt 256 colored terminal. 256 colors are supported  
correctly.

Maxim

--
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] fish_fish

2012-06-01 Thread Maxim Gonchar
 But for fish it is not the case, because 'if' is the command as well.
 It took some time for me to understand that I can do this in fish in the
 following way:
 cmd1 args1; and cmd2 args2
 if and cmd3 args3
 #some code
 end


 Cool. I hadn't though of doing it that way. What I usually do, which is
 significantly wordier, but (to me) a bit more readable is:

 if begin; cmd1args1; and cmd2 args2; and cmd3 arg3; end
 #some code
 end
Cool (:
I've missed it. You've designed fish in a very self-consistent way.

Maxim

--
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] fish_fish

2012-05-31 Thread Maxim Gonchar
 2. Yes, implicit cd is gone. I found it to be too easy to  
 accidentally invoke.
 That's pity. Can this feature be switchable?
 I'm sorry for being bothering. It would be painful to learn it back  
 again (:
 Do you use implicit cd in general,  or only for '..'?
I use it in general, or there would be no problem of making '..' function.

I do not use other folders from CDPATH and usually prepend path with './'  
or '/'
to avoid ambiguity with commands.

 4. I think fish is doing the right thing with false ; and  
 sdlkfjsdklf. That semicolon means that the 'and' is the beginning of  
 a new statement, and fish agrees with other shells (including fish  
 trunk) that this is an error. Remove the semicolon (false and  
 sdlkfjdsklf) and it does not error.
 This statement confronts all my fish experience. I use fish as default  
 shell for the long time.
 What about echo 123 and echo 234 and echo 123; and echo 234?
 You're completely right. What I wrote before about the semicolon was  
 nonsense.

 I think this behavior is not new. When I try your command false ; and  
 sdlkfjsdklf on a trunk fish build, it shows an error. Perhaps you have  
 a function installed that suppresses it.

 Anyways I agree it should not show an error in this case. I filed  
 https://github.com/ridiculousfish/fishfish/issues/20
You right. And did not know about it (:
Usually you do not need this feature in interactive mode.

The reason why I've noticed it is that now completions print errors to the  
screen.
The point is in __fish_complete_vi function, which makes completions for  
vim editor.

when I type 'vim' fish tries to load 'vi' completions after typing 'vi'.  
And since I do not
have 'vi' itself, just vim, it prints the error, event if the executable  
is checked.
I just didn't see it, because it was suppressed.

 Ok, thanks for sharing your thoughts. I'll investigate how much this  
 optimization is actually buying us and then we'll consider what to do  
 about it.

 _fish

OK. I think I am able now to switch to beta as default shell.

You have indeed done a huge work of updating fish. Thank you very much for  
it.

Maxim

--
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] fish_fish

2012-05-31 Thread Maxim Gonchar
 6) I like the idea of autosuggestions, I feel very comfortable and  
 natural with them. I would suggest to add the possibility to set a  
 color to the auto-suggested part (blinking?).
 Now it's the same as the other part of the command and if you loose  
 your attention for a while, you think that you get the command already  
 and you get an error when you try to execute it.
I've set
set fish_color_autosuggestion 505050
It's amazing!

I've tried to change background bu failed:
set fish_color_autosuggestion 00 --background FF
I've tried -b, --background, and --background=, but there is no effect.

But it's good in this way already (:

Maxim

--
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] fish_fish

2012-05-31 Thread Maxim Gonchar
 5. What you're seeing is the internalized scripts behavior, where at  
 build time, fish compiles all the default functions into itself (as C  
 strings). This reduces the number of files touched at launch. I did  
 this under the belief that these functions generally depended on each  
 other, and ought not to be modified. However, since this is causing  
 problems, we should restrict the functions internalized in this way,   
 or eliminate the optimization altogether.  I filed  
 https://github.com/ridiculousfish/fishfish/issues/15

 Can you share which functions from /usr/local/share/fish/ you override?
 fish_prompt is what I see from the beginning.
 As an example I've tried to override 'll'.

 (The fish_prompt case is particularly bad - I didn't realize the  
 effect that would have. I put my prompt in config.fish)
 I would prefer to have a possibility to override any function, even  
 internalized.
 Sometimes it's very useful, especially for debugging.

 And from the usage point of view, it is more clean when there are no  
 implicit limitations.

 Ok, thanks for sharing your thoughts. I'll investigate how much this  
 optimization is actually buying us and then we'll consider what to do  
 about it.
 _fish

I see that completions are also internalized.
I often modify default completions, so I keep default completions and  
functions in separate folders in
~/.config/fish .

And keybindings are now also can not be configured. Because you can not  
override fish_default_key_bindings. Can not
set it in config.fish, because fish resets bindings after reading it.
Maybe it worth making separate fish_user_keybindings function, that is  
loaded after fish_default_key_bindings, so
you get your own bindings along with defaults.

Maxim

--
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] fishfish: history search and history token search

2012-05-31 Thread Maxim Gonchar
Hi,

It seems that history search by Up/Down when command part is written isn't
colored anymore. Changing fish_color_search_match doesn't help.

The token search (AltUp, AltDown, history-token-search-forward/backward)
doesn't work anymore.

By the way, I use urxvt 256 colored terminal. 256 colors are supported
correctly.

Maxim

--
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] fish_fish

2012-05-31 Thread Maxim Gonchar
Right,

the only difficulty is 'if statement'.

in bash you could do something like this:
 if cmd1 args1  cmd2 args2  cmd3 args3
 then
 #some code
 fi

But for fish it is not the case, because 'if' is the command as well.
It took some time for me to understand that I can do this in fish in the  
following way:
 cmd1 args1; and cmd2 args2
 if and cmd3 args3
 #some code
 end

regards,
Maxim

On Fri, 01 Jun 2012 04:22:56 +0400, Philip Ganchev  
phil.ganc...@gmail.com wrote:

 On Thu, May 31, 2012 at 12:14 AM, ridiculous_fish
 corydo...@ridiculousfish.com wrote:

 On May 30, 2012, at 1:17 PM, Maxim Gonchar wrote:

 [...]
 4. I think fish is doing the right thing with false ; and sdlkfjsdklf.
 That semicolon means that the 'and' is the beginning of a new  
 statement, and
 fish agrees with other shells (including fish trunk) that this is an  
 error.
 Remove the semicolon (false and sdlkfjdsklf) and it does not error.

 This statement confronts all my fish experience. I use fish as default  
 shell
 for the long time.
 What about echo 123 and echo 234 and echo 123; and echo 234?

 If I might add to that: having 'and', 'or' and 'not' as separate
 commands seems conceptually simpler to me. Also, it is more useful for
 interactive use, because you can start executing a command like 'foo'
 and then add 'and bar'.

--
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] Announcing Open Beta for our fancy new fish fork

2012-05-30 Thread Maxim Gonchar
Hi ridiculous_fish,

it's a really news.

Congratulations with beta!

Maxim


On Wed, 30 May 2012 13:43:57 +0400, ridiculous_fish  
corydo...@ridiculousfish.com wrote:

 Hello fellow fish fans! I am ridiculous_fish, and I come bearing  
 lungfuls of new life!

 Over the past year, I and my partner Siteshwar have been working on a  
 fish fork. We've been modernizing fish's codebase, while adding some  
 truly compelling features and improving performance. We've been living  
 on this fork for months, and we think it's _awesome_. Compared to stock  
 fish, our branch is noticeably faster and easier to maintain, and its  
 new features have ruined me for all other shells. bash now tastes like  
 cardboard.

 Our fork is now in Open Beta, and we'd like to invite you to try it out!  
 We are interested in feedback and bug reports.

 We'd also like to start a discussion about our changes and whether/how  
 to incorporate them into fish trunk (which we would very much like to  
 do). Our changes are transformative and impact nearly every aspect of  
 fish's code base, so it is not to be undertaken lightly. But our changes  
 are also very compelling from the perspectives of both users and  
 maintainers, and our months of living-on have given us a lot of  
 confidence in them. Our branch is not only the best fish ever made; we  
 think it's the best POSIX command line shell, period.

 Here's how to get it!

   Main page: http://ridiculousfish.com/shell/
   Open beta page: http://ridiculousfish.com/shell/beta.html
   Release notes: http://ridiculousfish.com/shell/release_notes.html
   Gitorious page:  
 https://gitorious.org/~ridiculousfish/fish-shell/fishfish

 The relevant git branch is fish_fish.

 Please share your thoughts, reactions, rants, raves, and bug reports on  
 this list. If all goes well, we'll announce the Open Beta more widely in  
 the upcoming week.

 A few teaser improvements (for a longer list, see the Release Notes  
 above):

 - Autosuggestions (think URL fields in browsers)
 - 256 color support
 - Web-based configuration
 - Syntax highlighting is now multithreaded, so it doesn't cause  
 stuttering typing on slow disks / filesystems
 - Overall performance is way better
 - It's all in (sane) C++. No more string_buffer_t, array_list_t, or  
 hash_table_t, and no more halloc!


 --
 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] fish_fish

2012-05-30 Thread Maxim Gonchar
Hi,

So I'm trying new fish and have some questions and notes. It became really  
fast and amazing.

1) On archlinux default python is python3. So internalize script and  
webconfig scripts do not work out of the box, until i replace  
/usr/bin/python by /usr/bin/python2.

2) I see that I can not now execute directories. I.e. I can not use '..'  
as command to go to the upper directory.
Of course I can catch the event to handle it. But it doesn't colorize  
correct paths as green now. Is this feature completely deleted?

3) __fish_config_interactive.fish contains a command 'which -s'
I do not know what -s should mean, but my 'which' doesn't support this  
option (I've tried on arch, debian and ubuntu).
The other thing is that which outputs to the stderr if command not found.  
So it's better to use ^/dev/null redirection as well.

The problem is that 'which -s command-not-found' is also hardcoded in  
builtin_scripts.cpp, so it's not easy to understand why it keep claiming,  
even after modifying the __fish_config_interactive.fish

4) It seems that commands are interpreted even if they are not to be  
executed:
'false; and dfgsfhsfhethr' will cause an error.

That's bad, because it shows warnings if I try to test if command is valid:
type sdfsdfsdf /dev/null; and sdfsdfsdf

5) It ignores my prompt. It seems that it ignores my functions, if they  
override functions from /usr/local/share/fish.
It ignores them, even if I delete /usr/local/share/fish from  
$fish_function_path.
I also can not edit fish functions from 'share' with funced.

6) I like the idea of autosuggestions, I feel very comfortable and natural  
with them. I would suggest to add the possibility to set a color to the  
auto-suggested part (blinking?).
Now it's the same as the other part of the command and if you loose your  
attention for a while, you think that you get the command already and you  
get an error when you try to execute it.

best regards,
Maxim

--
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] fish_fish

2012-05-30 Thread Maxim Gonchar
Hi,
Thank you for you the answers.

 2. Yes, implicit cd is gone. I found it to be too easy to accidentally  
 invoke.
That's pity. Can this feature be switchable?
I'm sorry for being bothering. It would be painful to learn it back again  
(:

 4. I think fish is doing the right thing with false ; and sdlkfjsdklf.  
 That semicolon means that the 'and' is the beginning of a new statement,  
 and fish agrees with other shells (including fish trunk) that this is an  
 error. Remove the semicolon (false and sdlkfjdsklf) and it does not  
 error.
This statement confronts all my fish experience. I use fish as default  
shell for the long time.
What about echo 123 and echo 234 and echo 123; and echo 234?

I like very much the fact that fish switched from bashisms || and  to the
'and' and 'or' commands. It makes the syntax clean. Shell now do not need
to parse the whole line false  echo 123. Instead it have just to parse
two commands divided by semicolon false; and echo 123.
So in case you have 'and' and 'or' as logical units, you need that  
semicolon
to split the commands. false and sdlkfjdsklf doesn't issue an error,  
because
'false' command accepts 'and' and 'sdlkfjdsklf' as arguments and simply  
ignores them.
This doesn't make any sense.

And the actual usage:
which existingcommand; and existingcommand arg1 arg2 # should be executed
which notexistingcommand; and notexistingcommand arg1 arg2 # should not be  
executed and should not emit any warnings
which notexistingcommand and notexistingcommand arg1 arg2  # will try to  
find commands
notexistingcommand, and, notexistingcommand, arg1, arg2

I still do not understand the existing behavior.

 5. What you're seeing is the internalized scripts behavior, where at  
 build time, fish compiles all the default functions into itself (as C  
 strings). This reduces the number of files touched at launch. I did this  
 under the belief that these functions generally depended on each other,  
 and ought not to be modified. However, since this is causing problems,  
 we should restrict the functions internalized in this way, or eliminate  
 the optimization altogether.  I filed  
 https://github.com/ridiculousfish/fishfish/issues/15

  Can you share which functions from /usr/local/share/fish/ you override?
fish_prompt is what I see from the beginning.
As an example I've tried to override 'll'.

 (The fish_prompt case is particularly bad - I didn't realize the effect  
 that would have. I put my prompt in config.fish)
I would prefer to have a possibility to override any function, even  
internalized.
Sometimes it's very useful, especially for debugging.

And from the usage point of view, it is more clean when there are no  
implicit limitations.


 6. There is a color fish_color_autosuggestion which defaults to #555  
 (gray), but if your term doesn't support term256, you won't see it.  
 Maybe we could pick a color for classic 16 color terms. What term are  
 you using?
I've missed it, because my default color is gray (:
I will check them.

Maxim

--
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] fish_fish

2012-05-30 Thread Maxim Gonchar
There are two options to avoid this:
1) The CDPATH can be disabled for 'implicit cd'. Allow implicit cd to the  
current subdirectories and absolute subdirectories.
2) Allow implicid CD only to the directories, starting from '/' and '.'

Maxim

On Wed, 30 May 2012 23:44:33 +0400, ridiculous_fish  
corydo...@ridiculousfish.com wrote:

 Hi Peter,

 Do you use the implicit cd feature for any paths other than '..'?

 I removed implicit cd because I found it to be very confusing in  
 general, especially when combined with a CDPATH that includes ~

 But if it is restricted to paths where there can be no confusion, like  
 '..', then it would be OK. What would you think about that?

 _fish

 On May 30, 2012, at 5:25 AM, Peter Flood wrote:

 This is fantastic news, well done.

 Was just about to install it when I read this
I can not use '..' as command to go to the upper directory.
It ignores my prompt.
It seems that it ignores my functions

 Once these are fixed I'll give it a go and report back.



 On 30/05/2012 13:16, Maxim Gonchar wrote:
 Hi,

 So I'm trying new fish and have some questions and notes. It became  
 really
 fast and amazing.

 1) On archlinux default python is python3. So internalize script and
 webconfig scripts do not work out of the box, until i replace
 /usr/bin/python by /usr/bin/python2.

 2) I see that I can not now execute directories. I.e. I can not use  
 '..'
 as command to go to the upper directory.
 Of course I can catch the event to handle it. But it doesn't colorize
 correct paths as green now. Is this feature completely deleted?

 3) __fish_config_interactive.fish contains a command 'which -s'
 I do not know what -s should mean, but my 'which' doesn't support this
 option (I've tried on arch, debian and ubuntu).
 The other thing is that which outputs to the stderr if command not  
 found.
 So it's better to use ^/dev/null redirection as well.

 The problem is that 'which -s command-not-found' is also hardcoded in
 builtin_scripts.cpp, so it's not easy to understand why it keep  
 claiming,
 even after modifying the __fish_config_interactive.fish

 4) It seems that commands are interpreted even if they are not to be
 executed:
 'false; and dfgsfhsfhethr' will cause an error.

 That's bad, because it shows warnings if I try to test if command is  
 valid:
 type sdfsdfsdf/dev/null; and sdfsdfsdf

 5) It ignores my prompt. It seems that it ignores my functions, if they
 override functions from /usr/local/share/fish.
 It ignores them, even if I delete /usr/local/share/fish from
 $fish_function_path.
 I also can not edit fish functions from 'share' with funced.

 6) I like the idea of autosuggestions, I feel very comfortable and  
 natural
 with them. I would suggest to add the possibility to set a color to the
 auto-suggested part (blinking?).
 Now it's the same as the other part of the command and if you loose  
 your
 attention for a while, you think that you get the command already and  
 you
 get an error when you try to execute it.

 best regards,
 Maxim

 --
 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

--
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] .* expansion

2012-05-09 Thread Maxim Gonchar
Dave, do you want to say that your fish can expand character classes?
Like [a-zA-Z]?
Mine can not (:

On Tue, 08 May 2012 22:07:56 +0400, David Frascone d...@frascone.com  
wrote:

 That looks good.

 I usually just do .[a-zA-Z]*

 :)

 On Fri, May 4, 2012 at 2:41 AM, Maxim Gonchar gma...@gmail.com wrote:

 Hi fishers,

 I've noticed that it is very uncomfortable to use wild cards to work  
 with
 'hidden' files and folders, because when expanded it always produces '.'
 and '..' directories, which normally are almost never needed for  
 expansion.

 Consider the following example: you need to copy all the files and
 directories (including hidden) from one directory to another. You can  
 not
 write
 cp -r dir/* dir/.* destination/
 or
 cp -r dir/{,.}* destination/

 because it will be also expanded to the dir/.., which means that cp will
 copy also the contents of the outer directory. I've failed to find an
 example, where you really need these '.' and '..' in expansion. Does
 anyone knows them?

 So I propose to remove '.' and '..' from '.*' expansion. If someone need
 them, he can add them manually with with {} syntax.

 regards,
 Maxim


 --
 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] .* expansion

2012-05-04 Thread Maxim Gonchar
Hi fishers,

I've noticed that it is very uncomfortable to use wild cards to work with  
'hidden' files and folders, because when expanded it always produces '.'  
and '..' directories, which normally are almost never needed for expansion.

Consider the following example: you need to copy all the files and  
directories (including hidden) from one directory to another. You can not  
write
cp -r dir/* dir/.* destination/
or
cp -r dir/{,.}* destination/

because it will be also expanded to the dir/.., which means that cp will  
copy also the contents of the outer directory. I've failed to find an  
example, where you really need these '.' and '..' in expansion. Does  
anyone knows them?

So I propose to remove '.' and '..' from '.*' expansion. If someone need  
them, he can add them manually with with {} syntax.

regards,
Maxim

--
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] complete --arguments is executed when completing options

2012-04-16 Thread Maxim Gonchar
 I would say '-a' should only be evaluated if:
 1: If defined with '-s' or '-l', only when completing that specific  
 option.
 2: If not defined with '-s' or '-l' in all cases when not completing a
 option '-' or an argument to an option (where such argument is required).
I agree.
And if someone wants to specify common arguments for all '-s' and '-l'  
options there should be additional switch. But I can not imagine a usage  
for such a 'common' option for now.

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] complete --arguments is executed when completing options

2012-04-13 Thread Maxim Gonchar
 So it is intentional then. How can I prevent this behaviour? I toyed with
 __fish_contains_opt, but that is not optimal. I will try to parse
 commandline --current-token but it gets too complicated, it defies the
 simplicity of completions.
 I noticed that in nearly *all* occasions the --arguments script is
 executed, which is quite annoying if it takes long time just to complete
 just a simple option.

You can try this:
 complete -c foo -n not expr match (commandline -t) '^-.*'   
/dev/null -a '(sleep 2; echo aaa)'

the '-n' condition is cached. So as soon as you will use the same  
condition for all completions it is not going to be slow.

Maxim

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] complete --arguments is executed when completing options

2012-04-13 Thread Maxim Gonchar
 So it is intentional then. How can I prevent this behaviour? I toyed with
 __fish_contains_opt, but that is not optimal. I will try to parse
 commandline --current-token but it gets too complicated, it defies the
 simplicity of completions.
Well, the completions mechanism should be updated somehow. I also see some  
problems and limitations, that broke simplicity.
I hope I will do it sometime, if no one do it before.

Maxim

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] complete --arguments is executed when completing options

2012-04-13 Thread Maxim Gonchar
 I can definitely see the benefit of using it that way, however I think  
 its
 incorrect, and just exploiting a flaw in the complete command.
If you run 'complete --help' and check examples you will see the usage of  
command arguments with su. I think that it was done intentionally and is  
not a flaw.
But that is not for sure.

 There should be a distinction between option arguments and command
 arguments, and given the explanation in the help:

 OPTION_ARGUMENTS is parameter containing a space-separated list of
 possible option-arguments, which may contain subshells

 I would say '-a' is only to be used for option arguments.
 A new flag could be created for the use cases you describe above.
 (Of course it could be done the other way around as well, that does not
 really matter, as long as the help is updated and reflects the behavior)
This looks sane. And everything that should be done for it is to stop fish  
calling '-a' script when calling completion of 'cmd -'. Just like Sanskrit  
Fritz have written in first message.

Maxim


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] complete --arguments is executed when completing options

2012-04-12 Thread Maxim Gonchar
But if your --arguments script will return something starting with dash,  
fish have to complete it.
Consider this example:
 complete -c foo -a '-opt1 -opt2'

Maxim


On Fri, 13 Apr 2012 00:45:27 +0400, SanskritFritz  
sanskritfr...@gmail.com wrote:

 Consider this foo.fish file:

 complete --command foo --no-files --short-option a --long-option
 'an_example' --description 'example A'
 complete --command foo --no-files --arguments '(sleep 5s)' --description
 'slept'

 Type in the shell

 foo -

 and press tab. 5 seconds pass, before we get the result. If I delete the
 second line from foo.fish, the result is instantanious. AFAIK, the
 --arguments should not be executed when fish is completing options for a
 command.

 Is this a serious bug or am I missing something?

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] (Was: Current state of fish in gitorius)

2012-03-28 Thread Maxim Gonchar
hi,

the problems start when there are more than two completions. Or more t:han 10.

for example this:
vim /cern/root5.32/include/TTtab
…lude/TTabCom.h   (Unknown, 9,0kB)  …lude/TTime.h
  (Unknown, 4,0kB)  …lude/TTreeIndex.h   (Unknown, 3,3kB)
…lude/TTable.h (Unknown, 17kB)  …lude/TTimer.h
  (Unknown, 5,2kB)  …lude/TTreeInput.h   (Unknown, 2,1kB)
…lude/TTable3Points.h (Unknown, 2,4kB)  …lude/TTimeStamp.h
  (Unknown, 8,7kB)  …lude/TTreePlayer.h  (Unknown, 7,2kB)
…lude/TTableDescriptor.h  (Unknown, 7,3kB)  …lude/TToggle.h
  (Unknown, 3,9kB)  …lude/TTreeProxyGenerator.h  (Unknown, 3,2kB)
…lude/TTableIter.h(Unknown, 2,5kB)  …lude/TToggleGroup.h
  (Unknown, 2,5kB)  …lude/TTreeResult.h  (Unknown, 2,3kB)
…lude/TTableMap.h (Unknown, 3,6kB)  …lude/TTRAP.h
  (Unknown, 3,0kB)  …lude/TTreeRow.h (Unknown, 2,3kB)
…lude/TTablePadView3D.h   (Unknown, 4,9kB)  …lude/TTRD1.h
  (Unknown, 1,8kB)  …lude/TTreeSQL.h (Unknown, 4,7kB)
…lude/TTablePoints.h  (Unknown, 3,3kB)  …lude/TTRD2.h
  (Unknown, 2,0kB)  …lude/TTreeTableInterface.h  (Unknown, 2,8kB)
…lude/TTableSorter.h  (Unknown, 9,9kB)  …lude/TTree.h
   (Unknown, 24kB)  …lude/TTreeViewer.h   (Unknown, 10kB)
…lude/TTask.h (Unknown, 3,0kB)  …lude/TTreeCache.h
  (Unknown, 3,9kB)  …lude/TTUBE.h(Unknown, 3,2kB)
…lude/TText.h (Unknown, 3,2kB)  …lude/TTreeCacheUnzip.h
  (Unknown, 5,7kB)  …lude/TTUBS.h(Unknown, 2,3kB)
…lude/TTF.h   (Unknown, 4,4kB)  …lude/TTreeCloner.h
  (Unknown, 3,0kB)  …lude/TTVLVContainer.h   (Unknown, 8,3kB)
…lude/TThread.h   (Unknown, 8,5kB)
…lude/TTreeDrawArgsParser.h  (Unknown, 4,5kB)  …lude/TTVSession.h
 (Unknown, 5,0kB)
…lude/TThreadFactory.h(Unknown, 1,8kB)  …lude/TTreeFormula.h
  (Unknown, 9,4kB)
…lude/TThreadImp.h(Unknown, 2,2kB)
…lude/TTreeFormulaManager.h  (Unknown, 3,6kB)

It's definitely ineffective to choose one file with tab, when you can
type several letters to choose it. When you have to choose several
files, or several options from long lists. And when after pressing
tab your line is completed by first completion from the list, you
can not simply add one or two letters to get desired completion,
because you need to delete the completion first.

There is also one point, at least for me. When typing fast enough,
it's always annoying to type single key several times. It's more
smooth
and convenient when you need to press different keys.

But as you have noticed, it's the matter of attitude. A lot of people
prefer zsh's behavior.
I hope that if this behavior will be ever implemented in fish, it can
be turned off.

Maxim

On Wed, Mar 28, 2012 at 6:43 PM, raphael rsc sen...@8-0.net wrote:
 i think i didn't get your point before
 for example (fish  1.23.1-2)
 raphael@kikoolol ~ cd mo
 mobiles/  (Directory in .)  moc/  (Directory in .)
 raphael@kikoolol ~ cd mo

 i type mo to go to a directory, tab shows me which folders beginning
 with mo are available. Though the second tab does nothing, and i have
 to type the c or the b to go the folder wanted
 with my zsh completion (not the same as it was on video)
 i write :

 ─(16:38:%)── cd mo

 and if i hit tab it gives
 ─(16:38:%)── cd mobiles/

 and if i hit again tab, it shows
 ─(16:38:%)── cd moc/

 with one hit, maybe two, i go where i want to, instead of having to
 type a letter or more to have the same final behaviour
 i feel it saves me time, but maybe it's a question of habits

 raphael

 On Wed, Mar 28, 2012 at 4:06 PM, Martin Baehr
 mba...@email.archlab.tuwien.ac.at wrote:
 On Wed, Mar 28, 2012 at 03:22:25PM +0200, raphael rsc wrote:
  the thing that irritates me with fish completion as it is
  (maybe my version is old) is like basic bash completion, if multiple
  choice happens, you have to type more to get  the correct completion,
  how do you have to type more?
  having to hit tab many times to get to the right completion seems to be
  a lot more typing that a few keys to reducethe selection.
 well, question of feeling and taste

 possibly, but i was asking for a quantifization.
 you claim it is more typing, but i don't see how.

 i tried zsh and i can't figure out how the cycling through choices makes
 me type less. i am very interested in using the shell more efficiently
 so i'd like to understand how that works. not being familiar with zsh
 maybe i am missing something. hence i'd appreciate if you can explain
 how zsh makes you type less than fish for a particular case of
 completions.

 greetings, martin.
 --
 cooperative communication with sTeam      -     caudium, pike, roxen and unix
 services:   debugging, programming, training, linux sysadmin, web development
 --
 pike programmer      working in china                 societyserver.(org|net)
 foresight developer  community.gotpike.org                 foresightlinux.org
 unix sysadmin        (open-steam|www.caudium).org                 

Re: [Fish-users] Current state of fish in gitorius

2012-03-27 Thread Maxim Gonchar
On Mon, 26 Mar 2012 11:51:03 +0400, SanskritFritz
sanskritfr...@gmail.com wrote:

 Lets unite our efforts on your repo. I'll send merge requests whenever
 I updated any completions. Then you can send a merge request to the
 main repo. Does your repo contain any other changes to fish besides
 completions? It would be best to have a branch that contains only
 completion changes.
 If you don't want/have time to maintain the repo, I am willing to
 clone (I already did) and do this work on it myself.
 The goal would be to have a strong completions script base for easy
 merging into mainstream.
My repository master branch should be the same as main fish branch, except  
functions and completions.
There is one more branch with some changes in the code.

I think that it worth to make separate repository for this purpose.  
Something like fish-completions.
I can add new completions there and also update some outdated completions,  
like pacman.

Can you maintain it? The problem that I'm newbie to the git and still have  
a lot of problems using it.

regards,
Maxim

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] (Was: Current state of fish in gitorius)

2012-03-27 Thread Maxim Gonchar
 Yes, I'm willing to maintain it. Well I am in the same situation with
 git (I'm used to svn), but this will be a good opportunity to learn
 :-)
 So, I'm going to clone your repo with the name fish-shell-completions,
 merge all completions I have tested and found stable. Finally when
 everyone thinks it is ok, I'll send a merge request to the official
 repo. I plan to do this on a regular basis.

Great.

Please, pay attention to __fish_complete_list and 'call' functions.

I put __fish_complete_list  for example in 'ps' completion. It is useful
for cases when argument is a list of options, separated by comma (or other
separator).
For example:
ps -u rotab
will complete to ps -u root

then if you put comma and press tab again
ps -u root,tab
it will complete it by the list of users again.
I've already added it to some completions (mostly new).

Call function acts as eval, but doesn't separate quoted strings, so it
safer to use than eval. It's not finished for now and correctly accepts
redirection only as argument, like -r '/dev/
null'.

regards,
Maxim

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] commandline function and escaping

2012-01-23 Thread Maxim Gonchar
Hi,

I have a function which puts current commandline buffer to the editor.  
It's really useful sometimes.

function .edit_cmd --description 'Edit cmdline in editor'
set -l f (mktemp)
set -l p (commandline -C)
commandline -b  $f
vim -c set\ ft=fish $f
commandline -r (more $f)
commandline -C $p
rm $f
end

Recently, I've found that it breaks the quoted text. I.e. the command  
'echo first second third' is looses its double quotes when editing.
Unescaping is done in file builtin_commandline.c:199. I wonder if  
unescaping is really needed when cmd is not tokenized. I simply can not  
figure
out any possible usage of it.

So I propose to avoid unescape function when commandline is called without  
'tokenize' key.

What do you think about it?

regards,
Maxim

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] fishshell@gitorious merge request

2011-09-23 Thread Maxim Gonchar
Hi everyone,

I didn't find any information about merging rules. I've committed some  
fixes and updates for the completions. Do I need to something special  
before I make a merge request?
Are there any limitations on what I can change and commit?

regards,
Maxim Gonchar

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] disown command in fish

2011-07-25 Thread Maxim Gonchar
Hi,

you do not need disown in fish, because fish do it automatically. Just try the 
following
fish -c 'leafpad'

regards,
Maxim

On Monday 25 July 2011 23:48:53 Philipp Middendorf wrote:
 Hi
 
 I'm currently migrating to fish from bash and there's one thing that
 bothers me: In bash, I often used the disown command to not just send
 a job into the background but to detach it from the shell _entirely_.
 This means that closing the terminal doesn't close the program. For
 instance:
 
 firefox 
 disown -a
 close terminal
 
 and I still have firefox open (-a to disown all background jobs).
 
 Is this possible in fish? I've found a mailing list post from 2008 that
 received no ansers. I don't know if anything has changed since...
 
   Regards
 Philipp
 
 --
 Storage Efficiency Calculator
 This modeling tool is based on patent-pending intellectual property that
 has been used successfully in hundreds of IBM storage optimization engage-
 ments, worldwide.  Store less, Store more with what you own, Move data to 
 the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users
 

--
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] fish causes the parent process exit

2011-06-08 Thread Maxim Gonchar
Hi,

There happens a strange problem, when I try to call fish from some program. For 
example lua:
 os.execute 'fish'
 exit
After the fish exits the lua process exits also. This does not happen to the 
other shells. I can call bash, dash or tcsh and exit back to lua.

The same happens in python (os.system('fish')), vim (:!fish), mc, ranger 
(:shell fish).
This does not happen in another shells, i.e. if I start fish from bash, I exit 
to bash.

This behavior is very annoying, Do anybody know how to deal with it or at least 
why does this happen?

regards,
Maxim

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] fish causes the parent process exit

2011-06-08 Thread Maxim Gonchar
One more point. It happens only with interactive fish session.
 os.execute 'fish -c echo text'
does not suspend the caller.

Maxim

On Wednesday 08 June 2011 13:52:52 Adam H wrote:
 Very strange indeed..
 
 Both seem to use system() so I tried the following code:
 #include stdio.h
 #include stdlib.h
 
 int main(){
   system(fish);
   printf(Exiting nao!\n);
 }
 
 But could not reproduce it in my simple C program.
 Then I tried:
 
 #!/usr/bin/env python
 import os
 os.system(fish)
 print(Exiting nao)
 
 But it wasnt reproducible there either, so in Python it only seems to
 be the REPL that suffers from this.
 
 Then I tried:
 #!/usr/bin/env lua
 os.execute(fish)
 print(Exiting nao)
 
 In LUA, not reproducible there either, only in REPL.
 
 Which lead me to believe that it was read() that was the problem, so I
 wrote the following python code:
 #!/usr/bin/env python
 import os
 os.system(fish)
 raw_input()
 print(Exiting nao)
 
 And it stops the job, so I would guess that its some escape sequence
 sent by fish that read() does not like.
 
 
 2011/6/8 Grissiom chaos.pro...@gmail.com:
  On Wed, Jun 8, 2011 at 2:00 PM, Maxim Gonchar gma...@gmail.com wrote:
  Hi,
 
  There happens a strange problem, when I try to call fish from some 
  program. For example lua:
  os.execute 'fish'
  exit
  After the fish exits the lua process exits also. This does not happen to 
  the other shells. I can call bash, dash or tcsh and exit back to lua.
 
  The same happens in python (os.system('fish')), vim (:!fish), mc, ranger 
  (:shell fish).
  This does not happen in another shells, i.e. if I start fish from bash, I 
  exit to bash.
 
  This behavior is very annoying, Do anybody know how to deal with it or at 
  least why does this happen?
 
  The parent process does not exit, but suspended on my box. Don't know
  the root cause though ;(
 
  --
  Cheers,
  Grissiom
 
  --
  EditLive Enterprise is the world's most technically advanced content
  authoring tool. Experience the power of Track Changes, Inline Image
  Editing and ensure content is compliant with Accessibility Checking.
  http://p.sf.net/sfu/ephox-dev2dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 
 
 --
 EditLive Enterprise is the world's most technically advanced content
 authoring tool. Experience the power of Track Changes, Inline Image
 Editing and ensure content is compliant with Accessibility Checking.
 http://p.sf.net/sfu/ephox-dev2dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users
 

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users