Re: [dev] [st] pasting to gvim sucks

2013-04-13 Thread Christoph Lohmann
Greetings.

On Sat, 13 Apr 2013 08:53:08 +0200 Alexander Sedov alex0pla...@gmail.com 
wrote:
  Maybe pasting to st should be fixed too, so when newlines are pasted,
  they are translated to ^M.  But '\n' should be copied, otherwise pasting
  to graphical programs is broken.
 That's how urxvt does it and this is what my patch originally done
 (sort of, translation was in ttywrite while in should've been in
 selection notify or whatever is it called), but __20h__ applied it
 that way. If someone would convince him, that would be great, because
 making files with xclip -o is also terrible now.

I merged the patches from the list and applied them. St now does on copy
replace ’\r’ with ’\n’ and when it receives some paste item ’\n’ is  re‐
placed with ’\r’.

Comrades, please try out the latest st and report back in which applica‐
tion pasting does not work like you want it to behave and in which  case
(pasting to or copying from the application) this is happening.


Sincerely,

Christoph Lohmann




Re: [dev] [st] pasting to gvim sucks

2013-04-13 Thread p37sitdu
On Sat, Apr 13, 2013 at 08:53:08AM +0200, Christoph Lohmann wrote:
 Greetings.
 
 On Sat, 13 Apr 2013 08:53:08 +0200 Alexander Sedov alex0pla...@gmail.com 
 wrote:
   Maybe pasting to st should be fixed too, so when newlines are pasted,
   they are translated to ^M.  But '\n' should be copied, otherwise pasting
   to graphical programs is broken.
  That's how urxvt does it and this is what my patch originally done
  (sort of, translation was in ttywrite while in should've been in
  selection notify or whatever is it called), but __20h__ applied it
  that way. If someone would convince him, that would be great, because
  making files with xclip -o is also terrible now.
 
 I merged the patches from the list and applied them. St now does on copy
 replace ’\r’ with ’\n’ and when it receives some paste item ’\n’ is  re‐
 placed with ’\r’.
 
 Comrades, please try out the latest st and report back in which applica‐
 tion pasting does not work like you want it to behave and in which  case
 (pasting to or copying from the application) this is happening.
 
 
 Sincerely,
 
 Christoph Lohmann
 

Pasting from gvim to nano, from st to gvim and from st to vim works
as expected.

When copying from vim running in st, lots of spaces are copied, but it
is another problem.




Re: [dev] [st] pasting to gvim sucks

2013-04-13 Thread Christoph Lohmann
Greetings.

On Sat, 13 Apr 2013 12:29:08 +0200 p37si...@lavabit.com wrote:
 When copying from vim running in st, lots of spaces are copied, but it
 is another problem.

That’s  due to vim using BCE, which will make the remaining line full of
whitespaces with the corresponding background color  of  the  last  used
cursor.  This is used to save bandwith. But just in case: The other ter‐
minal emulators do the same. Use the internal yank commands if you  only
need the text.


Sincerely,

Christoph Lohmann




Re: [dev] [st] pasting to gvim sucks

2013-04-13 Thread Alexander Sedov
2013/4/13 Christoph Lohmann 2...@r-36.net:
 Greetings.
 I merged the patches from the list and applied them. St now does on copy
 replace ’\r’ with ’\n’ and when it receives some paste item ’\n’ is  re‐
 placed with ’\r’.
Thanks, that's much better than before! Every combination I'm aware of
works now.



Re: [dev] [st] pasting to gvim sucks

2013-04-12 Thread Alexander Sedov
 This is the reason why st is writing '\r', because is the code that is
 generated when you press return.
Yeah, it makes sense for pasting from st to st.
But pasting from, for one, surf to st suffers from ^J instead of ^M
(mcabber, nano, who knows what else), and pasting to file and, as
topicstarter states, to gvim is pain, too.
In text files, one usually sees ^J, so if selection is a chunk of
data, I'd rather expect it to obey Unix newlines.



Re: [dev] [st] pasting to gvim sucks

2013-04-12 Thread Roberto E. Vargas Caballero
 Yeah, it makes sense for pasting from st to st.
 But pasting from, for one, surf to st suffers from ^J instead of ^M
 (mcabber, nano, who knows what else), and pasting to file and, as
 topicstarter states, to gvim is pain, too.

Yeah, the problem here is you will have problems in both cases, some
programs will work and others no.

Maybe we should copy '\n', that is the common character in unix, and
translate from '\n' to '\r' when pasting. I think this approach could fix
the problem, no?



Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread Carlos Torres
this is a funny patch.  it must have been about 1 to 2 months ago that
there was another discussion about pasting to other apps and thats
when that carrige return appeared.  and now there is a patch to revert
that back...lol this is great, i look forward to another patch that
takes it back to \r :)


On Thu, Apr 11, 2013 at 10:47 AM,  p37si...@lavabit.com wrote:
 This patch makes behaviour consistent with xterm and comments.



Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread Martti Kühne
On Thu, Apr 11, 2013 at 5:22 PM, Carlos Torres vlaadbr...@gmail.com wrote:
 this is a funny patch.  it must have been about 1 to 2 months ago that
 there was another discussion about pasting to other apps and thats
 when that carrige return appeared.  and now there is a patch to revert
 that back...lol this is great, i look forward to another patch that
 takes it back to \r :)



I'd say this qualifies for a move to config.h.
I might be back later with a patch for that.

cheers!
mar77i



Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread Nick
On Thu, Apr 11, 2013 at 05:25:46PM +0200, Martti Kühne wrote:
 On Thu, Apr 11, 2013 at 5:22 PM, Carlos Torres vlaadbr...@gmail.com wrote:
  this is a funny patch.  it must have been about 1 to 2 months ago that
  there was another discussion about pasting to other apps and thats
  when that carrige return appeared.  and now there is a patch to revert
  that back...lol this is great, i look forward to another patch that
  takes it back to \r :)
 
 I'd say this qualifies for a move to config.h.
 I might be back later with a patch for that.

Umm, no. If you want to use st with x, y, z programs, set this to
\r, if you want to use a, b, c programs, set \n is a terrible idea.

Best to figure out what is more correct, do that, and patch any
applications that do things the wrong way.



Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread p37sitdu
On Thu, Apr 11, 2013 at 05:00:00PM +0100, Nick wrote:
 On Thu, Apr 11, 2013 at 05:25:46PM +0200, Martti Kühne wrote:
  On Thu, Apr 11, 2013 at 5:22 PM, Carlos Torres vlaadbr...@gmail.com wrote:
   this is a funny patch.  it must have been about 1 to 2 months ago that
   there was another discussion about pasting to other apps and thats
   when that carrige return appeared.  and now there is a patch to revert
   that back...lol this is great, i look forward to another patch that
   takes it back to \r :)
  
  I'd say this qualifies for a move to config.h.
  I might be back later with a patch for that.
 
 Umm, no. If you want to use st with x, y, z programs, set this to
 \r, if you want to use a, b, c programs, set \n is a terrible idea.
 
 Best to figure out what is more correct, do that, and patch any
 applications that do things the wrong way.
 

Maybe pasting to st should be fixed too, so when newlines are pasted,
they are translated to ^M.  But '\n' should be copied, otherwise pasting
to graphical programs is broken.




Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread Alexander Sedov
 Maybe pasting to st should be fixed too, so when newlines are pasted,
 they are translated to ^M.  But '\n' should be copied, otherwise pasting
 to graphical programs is broken.
That's how urxvt does it and this is what my patch originally done
(sort of, translation was in ttywrite while in should've been in
selection notify or whatever is it called), but __20h__ applied it
that way. If someone would convince him, that would be great, because
making files with xclip -o is also terrible now.



Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread Sam Watkins
On Thu, Apr 11, 2013 at 05:00:00PM +0100, Nick wrote:
 Best to figure out what is more correct, do that, and patch any
 applications that do things the wrong way.

I guess other terminals manage this okay, in spite of their faults,
why not check to see what they are doing?



Re: [dev] [st] pasting to gvim sucks

2013-04-11 Thread Roberto E. Vargas Caballero
  I'd say this qualifies for a move to config.h.
  I might be back later with a patch for that.

 Umm, no. If you want to use st with x, y, z programs, set this to
 \r, if you want to use a, b, c programs, set \n is a terrible idea.

 Best to figure out what is more correct, do that, and patch any
 applications that do things the wrong way.


This is the reason why st is writing '\r', because is the code that is
generated when you press return.