Re: firefox pasting using xclip replaces line ends with spaces
Greg Wooledge wrote: ... > I verified it using xclip -o and od. > > wooledg:~$ xclip -o | od -tx1 -An > 78 78 4e 31 79 0d 0a 7a 7a 71 6e 0d 0a 66 6f 6f > 20 62 61 72 20 62 61 7a 0d 0a > > As you can see, xclip is definitely retaining the carriage returns > and newlines. > > I suspect your problem is with this "Xenforum site". It must be using > something other than a standard textarea. it may be the case. note i am not posting this to fix that other issue i am only posting it for people who may run into it and think that there is some fix they can make still using xclip which may be possible but i never found it. however, for some reason xsel just works. that is the only point to my post. if you'd like to look at what xsel does different inside firefox then perhaps that would be interesting but a complete aside from the point of my initial post... songbird
Re: firefox pasting using xclip replaces line ends with spaces
On Wed, Oct 30, 2019 at 04:36:48PM -0400, songbird wrote: > the problem is that the file is one item per line > and the file is your basic utf8 or ascii like text > file with [cr][lf]: > > $ od -c list-alpha > 000 a c o n i t e \r \n a l f a l f a > 020 \r \n a l l i u m s ( b l u e , > 040 p u r p l e ) \r \n a s t e r s > 060 ( p u r p l e , w h i t e ) > 100 \r \n a s t i b i l e ( r e d ) > > > using the xclip command ends up with all of those going into one > blob when i paste it into a firefox editing box on a Xenforum site. I tested just now with a CR-LF file ("xclip -i bar") and pasted it into the textarea on the HTML page that I showed in my previous message. It worked fine. There are three separate lines in the textarea. No sign of the carriage returns, meaning the web browser probably removed them. I verified it using xclip -o and od. wooledg:~$ xclip -o | od -tx1 -An 78 78 4e 31 79 0d 0a 7a 7a 71 6e 0d 0a 66 6f 6f 20 62 61 72 20 62 61 7a 0d 0a As you can see, xclip is definitely retaining the carriage returns and newlines. I suspect your problem is with this "Xenforum site". It must be using something other than a standard textarea.
Re: firefox pasting using xclip replaces line ends with spaces
songbird (12019-10-30): > pasting into a terminal may work just fine. open up a blog > post or something on a website and it may or may not work. This is exactly what I did, and it worked. Your analysis of the problem is not correct. Regards, -- Nicolas George signature.asc Description: PGP signature
Re: firefox pasting using xclip replaces line ends with spaces
Greg Wooledge wrote: > On Wed, Oct 30, 2019 at 03:02:07PM -0400, songbird wrote: >> >> quick answer install and use xsel instead. >> >> >> a FYI, :) >> >> >> # did not work >> $ xclip -selection clip-board -i list-alpha > > Your subject header says, > "Subject: Re: firefox pasting using xclip replaces line ends with spaces" > > I am reporting that here, because your email body does not say what > the problem is, and there's no telling how the Subject header will be > altered as the thread progresses. the problem is that the file is one item per line and the file is your basic utf8 or ascii like text file with [cr][lf]: $ od -c list-alpha 000 a c o n i t e \r \n a l f a l f a 020 \r \n a l l i u m s ( b l u e , 040 p u r p l e ) \r \n a s t e r s 060 ( p u r p l e , w h i t e ) 100 \r \n a s t i b i l e ( r e d ) using the xclip command ends up with all of those going into one blob when i paste it into a firefox editing box on a Xenforum site. > I cannot reproduce the symptom you describe in the Subject. > > I tested BOTH directions: copying from firefox and pasting with "xclip -o" > into a terminal, as well as creating an HTML page with a textarea widget, > and then pasting into that with the mouse, after "xclip -i". pasting into a terminal may work just fine. open up a blog post or something on a website and it may or may not work. in the case i was trying to get it to work, well, it didn't so i had to go look on the web and try to find out what was going on. after about an hour of looking i found a recommendation to try xsel intead and that just worked on the first try. so i thought that was worth a post here just in case in the future someone else has the same issue and goes looking and maybe they won't have to search a whole hour to get something that works. > In both cases, the pasted output retained its newlines. > > The actual HTML I used for the test: > > >Text area test > > > > > > My terminal is urxvt (rxvt-unicode). Relevant package versions > are indicated below. > > ii firefox-esr68.2.0esr-1~deb10u1 amd64Mozilla Firefox web > browser - Extended Support Release (ESR) > ii rxvt-unicode 9.22-6 amd64RXVT-like terminal > emulator with Unicode and 256-color support > ii xclip 0.13-1 amd64command line interface to > X selections songbird
Re: firefox pasting using xclip replaces line ends with spaces
songbird (12019-10-30): > pastes this when i try to use it: > aconite alfalfa alliums (blue, purple) asters (purple, white) astibile (red) > babies breath bachelor buttons baptisia beans (...a lot...) bearded irises > (dark purple, purple, lavender,... You neglected to say why you consider this bad, I will assume that your original list was separated by newlines. For me, the test works, I get the paste with newlines, not spaces. Regards, -- Nicolas George signature.asc Description: PGP signature
Re: firefox pasting using xclip replaces line ends with spaces
Nicolas George wrote: > songbird (12019-10-30): ... >> # did not work >> $ xclip -selection clip-board -i list-alpha=20 > > It did work. It just used the selection called "clip-board" instead of > "clipboard". # does not work $ xclip -selection clipboard -i list-alpha pastes this when i try to use it: aconite alfalfa alliums (blue, purple) asters (purple, white) astibile (red) babies breath bachelor buttons baptisia beans (...a lot...) bearded irises (dark purple, purple, lavender,... songbird
Re: firefox pasting using xclip replaces line ends with spaces
On Wed, Oct 30, 2019 at 03:02:07PM -0400, songbird wrote: > > quick answer install and use xsel instead. > > > a FYI, :) > > > # did not work > $ xclip -selection clip-board -i list-alpha Your subject header says, "Subject: Re: firefox pasting using xclip replaces line ends with spaces" I am reporting that here, because your email body does not say what the problem is, and there's no telling how the Subject header will be altered as the thread progresses. I cannot reproduce the symptom you describe in the Subject. I tested BOTH directions: copying from firefox and pasting with "xclip -o" into a terminal, as well as creating an HTML page with a textarea widget, and then pasting into that with the mouse, after "xclip -i". In both cases, the pasted output retained its newlines. The actual HTML I used for the test: Text area test My terminal is urxvt (rxvt-unicode). Relevant package versions are indicated below. ii firefox-esr68.2.0esr-1~deb10u1 amd64Mozilla Firefox web browser - Extended Support Release (ESR) ii rxvt-unicode 9.22-6 amd64RXVT-like terminal emulator with Unicode and 256-color support ii xclip 0.13-1 amd64command line interface to X selections
Re: firefox pasting using xclip replaces line ends with spaces
songbird (12019-10-30): > # did not work > $ xclip -selection clip-board -i list-alpha It did work. It just used the selection called "clip-board" instead of "clipboard". Regards, -- Nicolas George signature.asc Description: PGP signature