Enhancement: Paste from file
Hi.
Downloading the files with a help of terminal codes (download.sh script) is the best thing in the newest iTerm2! It is just a killer feature.
Could you provide also reverse operation? I mean "Paste from file". In the simplest form it might be the same as "Paste Special > Advanced Paste" with additional "File..."field.
Thanks!
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Owner
You can go to finder and copy a file, then do Paste Special > Paste File Base64-Encoded. On the remote end do:
base64 --decode > filename
It would be nice to have an upload.sh that does this plus prompts iTerm2 to open a file picker, though.
- username-removed-55954 Milestone changed to %Feature Complete 3.1
Milestone changed to %Feature Complete 3.1
- username-removed-55954 mentioned in issue #4762 (closed)
mentioned in issue #4762 (closed)
Above instruction is not clear to me.
When I do 'Paste Special > Paste File Base64-Encoded' on the terminal, some popup is showing like below.
And when I click 'ok', it just pastes 9 lines. I think this should not be supposed?
Then after I do 'base64 --decode > filename', it never end.
What was wrong with me?
Thanks
- Owner
What's the file you're trying to paste? And what got pasted?
I forgot that you need to send an EOF after pasting. Control-D at the start of a line will do that.
I copied a text file in the finder, then I was trying to paste the text file. And when I pased it with the 'Paste File Base64-Encoded', I had something like that which had 9 lines.
ewovLyAgc3RyaW5nIGV4cHIgPSAiW10oZG91YmxlKiB4LCBkb3VibGUqIHApeyI7Ci8vICBleHByI Cs9ICIgc3RydWN0IEZGIHsiOwovLyAgZXhwciArPSAiIGludCBvcGVyYXRvcigpKGludCBpKSB7Ij sKLy8gIGV4cHIgKz0gIiByZXR1cm4gKCBpIDw9IDAgKSA/IDEgOiBpKm9wZXJhdG9yKCkoaS0xKTs iOwovLyAgZXhwciArPSAiIH07IjsKLy8gIGV4cHIgKz0gIiB9IGZmOyI7Ci8vICBleHByICs9ICIg cmV0dXJuIGZmKHhbMF0pOyI7Ci8vICBleHByICs9ICJ9IjsKLy8KLy8gIFRGMSogZiA9IG5ldyBUR jEoImYiLCBleHByLmNfc3RyKCksIDAsIDEwLCAwKTsKLy8gIGYtPkRyYXcoKTsKCmF1dG8gZiA9IF RGMSgiZiIsICJbXShkb3VibGUqIHgsIGRvdWJsZSogcCl7Y291dCA8PCB4WzBdIDw8IGVuZGw7IHJ ldHVybiBzaW4oeFswXSkrZ1JhbmRvbS0+VW5pZm9ybSgtMSwgMSk7IH0iLCAwLCAxLCAwKTsKZi5T ZXRSYW5nZSgwLDEpOwpmLkRyYXcoKTsKCn0K
- Owner
Georges-iMac:/Users/gnachman% base64 --decode > myfile ewovLyAgc3RyaW5nIGV4cHIgPSAiW10oZG91YmxlKiB4LCBkb3VibGUqIHApeyI7Ci8vICBleHByI Cs9ICIgc3RydWN0IEZGIHsiOwovLyAgZXhwciArPSAiIGludCBvcGVyYXRvcigpKGludCBpKSB7Ij sKLy8gIGV4cHIgKz0gIiByZXR1cm4gKCBpIDw9IDAgKSA/IDEgOiBpKm9wZXJhdG9yKCkoaS0xKTs iOwovLyAgZXhwciArPSAiIH07IjsKLy8gIGV4cHIgKz0gIiB9IGZmOyI7Ci8vICBleHByICs9ICIg cmV0dXJuIGZmKHhbMF0pOyI7Ci8vICBleHByICs9ICJ9IjsKLy8KLy8gIFRGMSogZiA9IG5ldyBUR jEoImYiLCBleHByLmNfc3RyKCksIDAsIDEwLCAwKTsKLy8gIGYtPkRyYXcoKTsKCmF1dG8gZiA9IF RGMSgiZiIsICJbXShkb3VibGUqIHgsIGRvdWJsZSogcCl7Y291dCA8PCB4WzBdIDw8IGVuZGw7IHJ ldHVybiBzaW4oeFswXSkrZ1JhbmRvbS0+VW5pZm9ybSgtMSwgMSk7IH0iLCAwLCAxLCAwKTsKZi5T ZXRSYW5nZSgwLDEpOwpmLkRyYXcoKTsKCn0K
At this point I press Control-D to signal end-of-file.
Georges-iMac:/Users/gnachman% cat myfile { // string expr = "[](double* x, double* p){"; // expr += " struct FF {"; // expr += " int operator()(int i) {"; // expr += " return ( i <= 0 ) ? 1 : i*operator()(i-1);"; // expr += " };"; // expr += " } ff;"; // expr += " return ff(x[0]);"; // expr += "}"; // // TF1* f = new TF1("f", expr.c_str(), 0, 10, 0); // f->Draw(); auto f = TF1("f", "[](double* x, double* p){cout << x[0] << endl; return sin(x[0])+gRandom->Uniform(-1, 1); }", 0, 1, 0); f.SetRange(0,1); f.Draw(); }
Thanks George. I was confused the order of command. I should have put the command for the 'base64 -d' first and then pasted. Now it works fine.
Thanks again for your help!
- username-removed-55954 closed
closed