HTY | 9 Jan 2012 08:02
Picon

please help: GNU Fish, key bindings---sorry to disturb you!

I am new to Fish and have some problems adding some features to it. I am
sorry to mail you knowing you are, in fact, not in the responsibility
for technical support, but your email address is the only one I could
find in fish's documentation. I wanted to do something like this: while
pressed Alt(\e)+p, fish adds a "|less" under the cursor in the command
line. So I wanted to bind Alt(\e)+g to something like "|grep", but the
command: bind \eg "\|grep" or anything I could think of did not work.
Wish you could spare a time for it, please!

--
Hormetjan Yiltiz
Department of Psychology
Peking University, China
100871

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
Stestagg | 9 Jan 2012 22:32
Picon
Gravatar

Re: please help: GNU Fish, key bindings---sorry to disturb you!

Hi



Hi

Don't worry, we've had several similar questions before.

This should work for you:

bind \cp "commandline -a '|less'"

Thanks

Steve Stagg

On Mon, Jan 9, 2012 at 7:02 AM, HTY <hyiltiz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I am new to Fish and have some problems adding some features to it. I am
sorry to mail you knowing you are, in fact, not in the responsibility
for technical support, but your email address is the only one I could
find in fish's documentation. I wanted to do something like this: while
pressed Alt(\e)+p, fish adds a "|less" under the cursor in the command
line. So I wanted to bind Alt(\e)+g to something like "|grep", but the
command: bind \eg "\|grep" or anything I could think of did not work.
Wish you could spare a time for it, please!

--
Hormetjan Yiltiz
Department of Psychology
Peking University, China
100871

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Fish-users mailing list
Fish-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
SanskritFritz | 9 Jan 2012 22:41
Picon

Re: please help: GNU Fish, key bindings---sorry to disturb you!

On Mon, Jan 9, 2012 at 8:02 AM, HTY <hyiltiz@...> wrote:
> I am new to Fish and have some problems adding some features to it. I am
> sorry to mail you knowing you are, in fact, not in the responsibility
> for technical support, but your email address is the only one I could
> find in fish's documentation. I wanted to do something like this: while
> pressed Alt(\e)+p, fish adds a "|less" under the cursor in the command
> line. So I wanted to bind Alt(\e)+g to something like "|grep", but the
> command: bind \eg "\|grep" or anything I could think of did not work.
> Wish you could spare a time for it, please!

You have to define a function like __fish_grep, similar to
__fish_paginate in /usr/share/fish/functions/__fish_paginate.fish and
bind it to Alt-G like this:
bind \eg '__fish_grep'

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
SanskritFritz | 9 Jan 2012 22:43
Picon

Re: please help: GNU Fish, key bindings---sorry to disturb you!

On Mon, Jan 9, 2012 at 10:32 PM, Stestagg <stestagg@...> wrote:
>
> bind \cp "commandline -a '|less'"

Rather
bind \eg "commandline -a '|grep'"

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
Maxim Gonchar | 24 Jan 2012 06:47
Picon

commandline function and escaping

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
Jan Kanis | 24 Jan 2012 19:01
Picon

Re: commandline function and escaping

I agree that 'commandline -b' indeed has a less-than-optimal behaviour. We could add a switch to tell it not to interpret escape characters, but I really can't think of a use for the current behaviour either, so I agree that it should just be fixed. I committed a fix to my personal branch on gitorious to test if it works.

Jan



On Tue, Jan 24, 2012 at 06:47, Maxim Gonchar <gmaxfl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
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-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Jan Kanis | 25 Jan 2012 01:39
Picon

Re: stderr in red

That stderred from github should also work with fish. Though it is a bit of a hack, using shared library preloading. Implementing such a feature in the shell would be cleaner. If someone implemented this and it could be disabled I would consider it.

Jan

On Wed, Dec 14, 2011 at 10:10, Mike Miller <fish-users-9N9vo3BbZlHk1uMJSBkQmQ@public.gmane.org> wrote:
Hi, saw this on hacker news tonight, and wondered if an option to print stderr
in red could be added to fish?

  https://github.com/sickill/stderred
  http://news.ycombinator.com/item?id=3349562

Looks like it could be a user friendly addition.

--
-Mike


 -------------------------------------------------------------
 Mike Miller             Earth, Sol, Orion Arm, Milky Way, VSC

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits?
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
Fish-users mailing list
Fish-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Maxim Gonchar | 25 Jan 2012 07:01
Picon

Re: commandline function and escaping

Hi,

> I agree that 'commandline -b' indeed has a less-than-optimal behaviour.  
> We could add a switch to tell it not to interpret escape characters, but  
> I
> really can't think of a use for the current behaviour either, so I agree
> that it should just be fixed. I committed a fix to my personal branch on
> gitorious to test if it works.

Yes, I also thought about this key. And decided that it is not really  
needed.
Indeed one can use 'echo (commandline -b)' to unescape cmd.

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

Error, am I compiling the right version

Hi

I've got a new machine and need to install fish. I've downloaded the 
current master branch from gitorious but am getting this error when I 
run make

...
gcc -g -O2 -std=c99 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 
-fno-optimize-sibling-calls -Wall 
-DLOCALEDIR=\"/usr/local/share/locale\" -DPREFIX=L\"/usr/local\" 
-DDATADIR=L\"/usr/local/share\" -DSYSCONFDIR=L\"/usr/local/etc\" 
-std=c99 -c -o common.o common.c
In file included from common.c:86:
util.c: In function ‘q_realloc’:
util.c:131: error: ‘ptrdiff_t’ undeclared (first use in this function)
util.c:131: error: (Each undeclared identifier is reported only once
util.c:131: error: for each function it appears in.)
util.c:131: error: expected ‘;’ before ‘diff’
util.c:144: error: ‘diff’ undeclared (first use in this function)
make: *** [common.o] Error 1

Is master the correct version to use?

Thanks

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
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-dev2
SanskritFritz | 30 Jan 2012 18:14
Picon

Re: Error, am I compiling the right version

On Mon, Jan 30, 2012 at 5:30 PM, info@...
<info@...> wrote:
> Hi
>
> I've got a new machine and need to install fish. I've downloaded the
> current master branch from gitorious but am getting this error when I
> run make
>
> ...
> gcc -g -O2 -std=c99 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
> -fno-optimize-sibling-calls -Wall
> -DLOCALEDIR=\"/usr/local/share/locale\" -DPREFIX=L\"/usr/local\"
> -DDATADIR=L\"/usr/local/share\" -DSYSCONFDIR=L\"/usr/local/etc\"
> -std=c99 -c -o common.o common.c
> In file included from common.c:86:
> util.c: In function ‘q_realloc’:
> util.c:131: error: ‘ptrdiff_t’ undeclared (first use in this function)
> util.c:131: error: (Each undeclared identifier is reported only once
> util.c:131: error: for each function it appears in.)
> util.c:131: error: expected ‘;’ before ‘diff’
> util.c:144: error: ‘diff’ undeclared (first use in this function)
> make: *** [common.o] Error 1
>
> Is master the correct version to use?

I have just successfully compiled the following clone on archlinux
using gcc 4.6.2:
git://gitorious.org/fish-shell/fish-shell.git
I guess that is the master.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
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-dev2

Gmane