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. 

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

2012-08-24 Thread Jan Kanis
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://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] Copying and pasting long commands

2012-08-23 Thread Jon Clayden
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


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

2012-08-23 Thread David Frascone
And, for those not running osx:

codemonkey@monkeytree ~/W/MonkeyTools alias pbcopy 'xsel --clipboard
--input'
codemonkey@monkeytree ~/W/MonkeyTools alias pbpaste 'xsel --clipboard
--output'


-Dave

On Thu, Aug 23, 2012 at 3:56 AM, Jon Clayden jon.clay...@gmail.com wrote:

 Fair enough, but then why have the shell insert the ellipsis
 characters in the first place? Personally I would rather not have the
 visual continuation cue and be able to copy/paste simply. Long
 commands can be copy/pasted perfectly successfully under bash, so
 unless Terminal.app does something special in that case(?), it seems
 like it is something that the shell can influence. Admittedly I don't
 know the details of what goes on under the surface here, but I'm
 slightly surprised that this is so controversial.

 Jon


 On 23 August 2012 08:33, pants pa...@cs.hmc.edu wrote:
  On Thu, Aug 23, 2012 at 08:24:55AM +0100, Jon Clayden wrote:
  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.
 
  Possible, but hardly desirable.  In general, programming a shell to
  second-guess user input is not a good practice.  Suppose I wanted to
  enter an ellipsis character followed by a newline in some script I was
  writing on the command line; with a change as you describe, this is no
  longer possible.
 
  pants.
 
 
 --
  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] Copying and pasting long commands

2012-08-23 Thread Kevin Ballard
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