Beni Cherniavsky | 4 Aug 2009 13:24
Gravatar

Re: how to kill current process in 1 easy step

Forgot reply-to-list again.  Relevant parts of of disscusion (with
Radu's permission):

On Fri, Jul 24, 2009 at 13:20, Beni Cherniavsky<cben@...> wrote:
...
> The fish name for $$ is %self:
...
> The logic behind the notation is that in fish, % expands to process IDs.
> [There is a small downside to reserving "%self" - it means you can't
> use it to find the PIDs of programs whose names start with "self".
> Maybe "%%" would be a better notation?]
>

On Fri, Jul 24, 2009 at 13:46, Radu Benea<kitanatahu@...> wrote:
> It's just that I sometimes type an awful lot of commands trying to find the
> correct syntax for something and just need the last command remembered in
> history (the correct one)
> Like a few days ago I tried to find the correct way to make a flv file with
> mencoder and I tried like 50 variants till I was satisfied, I could safely
> paste just the last command in a shell which remembers history and forget
> about the rest, so I don't have so many useless items in history.
>
> Best regards,
>  Radu
>

On Sun, Jul 26, 2009 at 15:03, Beni Cherniavsky<cben@...> wrote:
> Usually such junk commands don't bother me.
> Next time I need them, I'd type "mencoder <Up>" and get the last such
> command, presumably the working one.  Also, after re-using the right command
(Continue reading)

gvsteen | 4 Aug 2009 18:11
Picon
Favicon

I like some parts of fish more than other parts


Dear List, 

I have been using Fish since more than a year now as my default shell. There are two things that I really like: 

1) colored and underlined input/output in interactive sessions 

2) easy search of substrings in Fish's history 

However, there are also some things that I do not like so much in Fish: 

1) Some urls have to be escaped in Fish (or they have to be put between quotation marks). For the handling of
urls I prefer Bash to Fish. 

2) I am very enthousiast about Fish's scripting possibilities either. I do appreciate its consistent
syntax (compared to Bash). However, I hardly use this syntax. When I need a script of any length I am more
inclined to use Python anyway. IMHO Python has an even more consistent syntax, and it offers many
libraries on top of Fish. 

3) Also, Bash code is so omnipresent nowadays that quite regularly I feel the urge to start a Bash session
anyway. 

Because I do not seem to use Fish's scripting possibilities anyway, I would actually prefer a shell like
this: 

1) Fish's colored and underlined input/output in interactive sessions 

2) Fish's easy search of substrings in the history file 

3) Support for Bash (or any other) syntax 
(Continue reading)

Isaac Dupree | 4 Aug 2009 18:31

Re: I like some parts of fish more than other parts

gvsteen@... wrote:
> Dear List, 
> 
> I have been using Fish since more than a year now as my default shell. There are two things that I really like: 
> ...

Oh yes! I want about the same thing as you, and I did some preliminary 
looking-around earlier and posted to the mailing-list.  I just didn't 
find time to look into it more closely than to guess that it would take 
a fair amount of effort to implement

(for example, it may depend on how good Bash's parsing code is -- if 
it's good enough for our purposes, we may be able to re-use it for 
syntax hilighting)

It might also be a good step to ask the Bash devs what they think of the 
idea(s), because one approach might be to incrementally add patches to 
Bash such that it natively supports these features.  (In some cases 
these patches might use parts of fish code, if it turned out to be helpful.)

-Isaac

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
gvsteen | 4 Aug 2009 23:28
Picon
Favicon

Re: I like some parts of fish more than other parts


Hi Isaac, 

> Oh yes! I want about the same thing as you, and I did some
> preliminary looking-around earlier and posted to the
> mailing-list. I just didn't find time to look into it
> more closely than to guess that it would take a fair amount
> of effort to implement

Thank you for your answer. Sorry I missed your earlier post I just read it now. It is clear indeed that it is not
a thing that can be implemented very quickly.  

I took a quick look at the readline library. I think it should be possible to change readline's commands
"history-search-forward" and "history-search-backward", so that they match "real substrings"
instead of "left substrings". [I don't feel very comfortable with "reverse-search-history" and
"forward-search-history".] 

The other part, "on the fly highlighting and underlining" will be a lot more difficult to implement.  

> (for example, it may depend on how good Bash's parsing code
> is -- if it's good enough for our purposes, we may be able
> to re-use it for syntax hilighting)

I am not fluent at c, I guess the language in which Bash is written. So I am afraid that would be beyond my
capabilities. 

> It might also be a good step to ask the Bash devs what they
> think of the idea(s), because one approach might be to
> incrementally add patches to Bash such that it natively
> supports these features.  (In some cases these patches
(Continue reading)

Daniel Baucom | 4 Aug 2009 23:42
Picon
Gravatar

Color Question

I can't seem to find it in the documents, does fish have support for the 
xterm 256 color palette when changing colors of settings like the prompt?

Thanks,
Daniel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
gvsteen | 5 Aug 2009 11:37
Picon
Favicon

Re: I like some parts of fish more than other parts


Hi Isaac - and others who would like to support a Bash feature request, 

> Very good idea! Many more regular Bash users will probably be 
> interested in these Fish features. I will write up a draft this 
> for an email that we may send to the Bash devs. I will first 
> drop it here to collect comments from you and other Fish users.

Here is a draft for an email to the Bash developers: 

"""To: bug-bash@..., Chet Ramey 
Subject: Two Bash feature requests (based on Fish). 

Dear Bash developers, 

We are long-time users of Bash. A few years ago we encountered an alternative Linux shell called Fish. For us
this shell has two compelling features that we would love to avail of in Bash: 

1)Fish features "on the fly COLORING and UNDERLINING".

a."On the fly COLORING": If you type the name of a binary - or a command - you can immediately see if that binary
- or command - exists, because if it exists it would be shown in green on the command-line. If the binary does
not exist it will be shown in red, so that you know that the binary/command is not available. This may
indicate to you that you made a typo. 

b."On the fly UNDERLINING": If you start typing the name of a file - or a command - you can immediately see if
the pattern you typed so far coincides with an actual file - or command - on your system. If a file matching
the pattern exists, it will be underlined. If a file matching the pattern does not exist, what you type will
not be underlined. 

(Continue reading)

Isaac Dupree | 5 Aug 2009 16:31

Re: I like some parts of fish more than other parts

gvsteen@... wrote:
> We are long-time users of Bash. A few years ago we encountered an alternative Linux shell called Fish. For
us this shell has two compelling features that we would love to avail of in Bash: 

yup.  Provide a link to fishshell.org ?

> 1)Fish features "on the fly COLORING and UNDERLINING".
> 
> a."On the fly COLORING": If you type the name of a binary - or a command - you can immediately see if that
binary - or command - exists, because if it exists it would be shown in green on the command-line. If the
binary does not exist it will be shown in red, so that you know that the binary/command is not available.
This may indicate to you that you made a typo. 
> 
> b."On the fly UNDERLINING": If you start typing the name of a file - or a command - you can immediately see if
the pattern you typed so far coincides with an actual file - or command - on your system. If a file matching
the pattern exists, it will be underlined. If a file matching the pattern does not exist, what you type will
not be underlined. 

ah, those things are worth it and possibly maybe simpler than full 
syntax hilighting.  Also Fish hilights the name of special words such as 
'if' and 'for' as though they were commands.  (For extra sophistication, 
it could use different colors for builtin; function; executable-file on 
PATH; etc.; but that might be too much craziness.)

(Bash has an option for advanced tab-completion too, which means it must 
know something useful about its own syntax, but for all we know it might 
be too slow for hilighting purposes.)

> 2)Fish's standard history search behaves a bit like the "history-search-forward" and
"history-search-backward" functions from the readline library. However readline's
(Continue reading)

gvsteen | 5 Aug 2009 18:08
Picon
Favicon

Re: I like some parts of fish more than other parts


> yup.  Provide a link to fishshell.org ?

I will do that. 

> ah, those things are worth it and possibly maybe simpler
> than full syntax hilighting.  Also Fish hilights the
> name of special words such as 'if' and 'for' as though they
> were commands.  

> (For extra sophistication, it could use
> different colors for builtin; function; executable-file on
> PATH; etc.; but that might be too much craziness.)

Yes, let us not ask too much. 

[snip] 

> I admit that I do not understand the history searching very
> well. I never figured out how to use Bash history except the
> up and down arrow keys, and Fish history only through the
> (often troublesome) feature of pressing up or down arrow
> when there is some text on the line that you've
> written/modified.  It's quite possible that if I did
> research and put into my command prompt (made up), "C-a:
> search back; C-b: search front; C-e: ..." so that I could
> remember them whenever I needed them, then I could be happy
> with Bash's history features?  Tell me about why Bash's
> issues.

(Continue reading)

gvsteen | 5 Aug 2009 18:11
Picon
Favicon

Re: I like some parts of fish more than other parts


Hi Beni, 

Thank you for your comments!

> And don't forget:
> 3) MULTI-LINE editing!

As far as I know Bash supports multi-line editing as well. (see e.g.
http://www.talug.org/events/20030709/cmdline_history.html) And to be honest, even if Bash did not
it, this would not be my top priority anyway. Why not use an editor to do multi-line editing!? 

> Also, fish coloring is smarter than you explain.  It
> also covers
> lexical stuff like (mis)matched parens and quotes, 

This is a good point to add. I will add it. 

> and
> anything that
> can be completed, e.g. (un)known options to a command.

Bash supports tab-completion too (see Isaac's mail). 

Can I count you as a signer of the "coloring and underlining" feature request? 

Guido

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
(Continue reading)

Philip Ganchev | 6 Aug 2009 00:49
Picon

Re: Color Question

On Tue, Aug 4, 2009 at 5:42 PM, Daniel Baucom<loudambiance@...> wrote:
> I can't seem to find it in the documents, does fish have support for the
> xterm 256 color palette when changing colors of settings like the prompt?

I don't know, but have you tried to echo color control sequences from
that palette?

The prompt is defined in the function "fish_prompt". You can see how
this function is defined by using the command "functions fish_prompt".
The default function that comes installed with Fish is defined in
/usr/share/fish/functions/fish_prompt.fish . To modify it, you need to
define a function in file ~/config/fish/functions/fish_prompt.fish .

Philip

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

Gmane