[Fish-users] Re: Proper behavior on very long prompt?

2013-06-20 Thread Tony Wang
I dig around the code. And there was such comment before
the judgement if to show “ 

    /*
      Ignore prompts wider than the screen - only print a two
      character placeholder...

      It would be cool to truncate the prompt, but because it can
      contain escape sequences, this is harder than you'd think.
    */

I’d like an example how the “escape sequence” breaks the wrapping,
and also I can check how bash/zsh handle it.

I tried to remove the “ “ code and it seems working fine.
I say, if the user has really crazy stuff to reach the right end of
the prompt, he should take care of the crappy situation. I believe
for most users, that’s not the case. (Or am I being naive?)

At least, I’m thankful if (at least) there can be a variable to
control it. no replacement to “ “ should be the default.

-- 
BR,
Tony Wang

On June 17, 2013 at 15:18:23, ridiculous_fish (corydo...@ridiculousfish.com) 
wrote:

Hi Tony,  

fish does not attempt to wrap or truncate long prompts. Prompts often contain 
ANSI escape sequences, which make them difficult to wrap or truncate.  

What you can do is inspect the value of $COLUMNS in your fish_prompt, and avoid 
outputting one that is too long. If you have any other ideas or suggestions for 
what fish should do here, I'd love to hear them.  

Thanks,  
_fish  

On Jun 15, 2013, at 8:04 AM, Tony Wang www...@gmail.com wrote:  

 Hi,  
  
 I’ve noticed that if the prompt is very long,  
 (longer than the window width), it’ll become  
 a single ‘’, and it even won’t show a second  
 line.  
  
 What’s the consideration behind it?  
 I don’t think it’s friendly to users.  
 I tried to google, but found nothing.  
  
 Is there any configuration to change that?  
 Or, can I check if it happens, so I can try to  
 show something abbreviated instead?  
  
 Thanks! :)  
  
 --  
 BR,  
 Tony Wang  
  
 --
   
 This SF.net email is sponsored by Windows:  
  
 Build for Windows Store.  
  
 http://p.sf.net/sfu/windows-dev2dev  
 ___  
 Fish-users mailing list  
 Fish-users@lists.sourceforge.net  
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] “fg -”

2013-06-20 Thread Elias Assmann
Hi,

In bash, I regularly use the “fg -” shortcut (it means switch to 
“previous job“, while “fg +” means “current job”).  It is handy for 
alternating between two jobs.

As far as I can see, fish's “fg” cannot do this, or am I missing 
something?  If not, are there any plans to support this particular 
“bashism“ in fish?


Elias

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] “fg -”

2013-06-20 Thread Robert Carpenter
Elias,

I do this all the time under fish and have no problem. ^z to background a
running task, `jobs` to see what is running, `fg` or `fg N` to bring
something forward.  It even works with the `command ` syntax to background
a job at command time.

Robert


On Thu, Jun 20, 2013 at 10:19 AM, Elias Assmann elias.assm...@gmail.comwrote:

 Hi,

 In bash, I regularly use the “fg -” shortcut (it means switch to
 “previous job“, while “fg +” means “current job”).  It is handy for
 alternating between two jobs.

 As far as I can see, fish's “fg” cannot do this, or am I missing
 something?  If not, are there any plans to support this particular
 “bashism“ in fish?


 Elias


 --
 This SF.net email is sponsored by Windows:

 Build for Windows Store.

 http://p.sf.net/sfu/windows-dev2dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] “fg -”

2013-06-20 Thread Chris Wright
Synopsis: fg [PID]

So if you have the PID of the process, you can use that directly. Otherwise
you can use the job - process mapping operation, '%', to specify which job
to put to the foreground.


2013/6/20 Robert Carpenter rob...@robacarp.com

 Ah, indeed, I think I read your initial post too quickly.

 In playing around with fg/bg just now, I've noticed that you have can't
 just specify a number: `fg 1`, but instead have to specify it like this:
 `fg %1`




 On Thu, Jun 20, 2013 at 11:05 AM, Elias Assmann 
 elias.assm...@gmail.comwrote:

 On 06/20/2013 06:49 PM, Robert Carpenter wrote:

 I do this all the time under fish and have no problem. ^z to background
 a running task, `jobs` to see what is running, `fg` or `fg N` to bring
 something forward.  It even works with the `command ` syntax to
 background a job at command time.


 “fg” and “fg %n” are very similar in both shells; “fg” means “bring the
 most recent job to the foreground”.

 Bash offers the additional syntax “fg -” which brings the
 next-most-recent job to the foreground.  This is useful for alternating
 between two jobs.  Let's say we start two terminal applications:

 $ octave
 octave:1 ^Z
 [1]+  Stopped octave
 $ emacs -nw
 ^Z
 [2]+  Stopped emacs -nw
 $ jobs
 [1]-  Stopped octave
 [2]+  Stopped emacs -nw

 Note the “+” and “-”.  Now, successive “fg -”s switch back and forth:

 $ fg -
 octave
 ^Z
 $ fg -
 emacs -nw

 By the way, bash's “fg” offers another nicety: it remembers which jobs
 were started in the background (i.e. with “”, rather than sent to the
 background later) and excludes them from “fg [-]”.  In the example, say I
 open a document with “gv ”; if I then say “fg” it is unlikely that I want
 to bring “gv” to the foreground.


 Elias




 --
 This SF.net email is sponsored by Windows:

 Build for Windows Store.

 http://p.sf.net/sfu/windows-dev2dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users