ish icon indicating copy to clipboard operation
ish copied to clipboard

Can't copy text more than 50 lines

Open madmongoose opened this issue 2 years ago • 9 comments

I can't copy the text output if it goes beyond one screen. For example the output with "cat".

There is a 300 line yaml file. I'm trying to output and copy the contents of the file through cat. I select the text and pull down, but it fails - the selection is reset. Tried writing a python script with pyperclip - doesn't work in iSH. Tried xclip - requires x11.

Ladies and gentlemen, tell me how to copy text in ish if it goes beyond one screen.

madmongoose avatar Apr 27 '23 13:04 madmongoose

Hi! You can also copy things by redirecting to /dev/clipboard, like this: cat file.yml > /dev/clipboard

Mnpn avatar Apr 27 '23 14:04 Mnpn

Hi! You can also copy things by redirecting to /dev/clipboard, like this: cat file.yml > /dev/clipboard

Oh, thanks a lot! I will try in few minutes!

madmongoose avatar Apr 27 '23 14:04 madmongoose

Amazing! How could I miss it) Thanks a lot again.

madmongoose avatar Apr 27 '23 14:04 madmongoose

Haha no worries - glad it could be easily resolved!

Mnpn avatar Apr 27 '23 14:04 Mnpn

If you don’t mind I’m going to reopen this to track text selection being unusable.

saagarjha avatar Apr 27 '23 14:04 saagarjha

Hi! You can also copy things by redirecting to /dev/clipboard, like this: cat file.yml > /dev/clipboard

That is really useful. I’m happy that I found it. Is it also possible to use /dev/clipboard inside vim for y/p please?

TravelTrader avatar May 10 '23 05:05 TravelTrader

Appears to be a new bug in iOS 16. fuck webview

tbodt avatar Jun 03 '23 02:06 tbodt

I confirm that when copying more than 100-105 lines of code (for example, from chatGPT) to vim, the last lines are deleted. At the same time, it is copied normally to Apple Notes. I use "cat /dev/clipboard > file.py" to avoid this.

madmongoose avatar Jun 05 '23 10:06 madmongoose

Hi! You can also copy things by redirecting to /dev/clipboard, like this: cat file.yml > /dev/clipboard

That is really useful. I’m happy that I found it. Is it also possible to use /dev/clipboard inside vim for y/p please?

Vim installed in in iSH by apk add vim seems compiled without "clipboard" function, (by checking using :version inside vim), thus y/p won't communicate with clipboard out vim itself. I tried hook yank action and remap p finally achieved that goal. You could take it as a reference.


function! WriteVariableToFile()
    let content = @"
    call writefile([content], '/dev/clipboard')
    " echo "Variable written to clipnoard"
endfunction
command! WriteVariableToFile call WriteVariableToFile()
autocmd TextYankPost * call WriteVariableToFile()

function! ReplaceRegisterContent()
    let lines = readfile('/dev/clipboard')
    let content = join(lines, "\n")
    call setreg('"', content)
endfunction
command! ReplaceRegisterContent call ReplaceRegisterContent()
nnoremap <silent> p :call ReplaceRegisterContent()<CR>p

@TravelTrader

suckerSlayer avatar Jan 14 '24 03:01 suckerSlayer