Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:17 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : HELP needed with Cut/Paste on RPi (PuTTY)

     Page 1 of 2    
Author Message
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 07:18am 07 Sep 2018
Copy link to clipboard 
Print this post

What I am wanting to achieve (within Raspbian on a RPi) is to copy code from a .BAS file (which I can open in Text Editor) and Paste it into the MM Editor screen which is displayed in PuTTY (liken this to TeraTerm on a Windows machine). I also want to do the reverse, i.e. copy code from the MM (PuTTY) and paste it into 'Text Editor'.


So I have successfully installed PuTTY on a RPi (latest version of Raspbian GUI) and connected up a MM which can be seen/controlled.

BUT I just cannot find a way to copy 'text' between PuTTY and the Text Editor.

If anyone out there has the full version of Raspbian installed on their RPi, please can you try and help me!

To install PuTTY I simply followed these three steps:
1> sudo apt-get update
2> sudo apt-get upgrade
3> sudo apt-get install putty -y

I then hooked up a MicroMite and opened a 'link' to it. All is good at this point.

I can copy some text from the built in Text Editor (under the 'Accessories' tab) and Paste it back into Text Editor (confirming it is on the 'clipboard'). However, I just cannot Paste it into PuTTY.

For reference, PuTTY installed on a Windows machine does work - default is Right-Click mouse, and the clipboard is pasted into the current cursor position. (This can be adjusted within PuTTY settings to make a Menu appear on Right-Click, to then allow selecting 'Paste' from the subsequent drop-down list).

RPi PuTTY has Ctrl+Right-Click to bring up a Menu, from which there is a 'Copy All' option. Upon selecting this, I cannot Paste 'it' into either PuTTY or into Text Editor.

Please can someone help!

NOTE: I am needing to use PuTTY rather than another 'app' UNLESS anyone can get either MMEDIT or GFXTERM running on a RPi . . . .
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1003
Posted: 07:53am 07 Sep 2018
Copy link to clipboard 
Print this post

Hi,
Link below should be of some use. I have written all my Pi-cromite code in MMEdit and copied to clipboard and pasted directly into the Pi-cromite basic editor using putty.
Shift + INS is used to do the paste. (the stand alone INSert key, not the one on the keypad).

See this link for an add on the MMEdit that automatically puts the code in the clipboard and adds a few keystrokes to save it and automatically run it when pasted.


MMEdit and Pi-cromite


PS. Just re-read your post, this may be not what you are after.I read MMEdit when you are talking about the MM editor.

Regards
GerryEdited by disco4now 2018-09-08
Latest F4 Latest H7 FotS
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 08:02am 07 Sep 2018
Copy link to clipboard 
Print this post

Thanks Gerry.

I have just had partial success with Shift + Ins (paste) and Ctrl+Shift (copy).

However, it is only pasting in one line (from Text Editor) when I am in the MM's Editor screen (i.e. F4). BUT when in the Command Prompt, it Pastes ALL the lines?


Edited by WhiteWizzard 2018-09-08
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 08:11am 07 Sep 2018
Copy link to clipboard 
Print this post

Looks like how I copy text from Text Editor (TE) has different results upon pasting into PuTTY.

Using Ctrl-C (within TE) will paste only the first line from the clipboard into MM's Editor
Using Right-Click and then selecting 'Copy' will take the first line (excluding the last character from the first line) and the second line (excluding the first character from the second line) and make then one line in MM's Editor. It ignores any more lines from the clipboard.


So possibly a CR LF issue in both PuTTY and TE.

Will continue to experiment . . . .
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 08:14am 07 Sep 2018
Copy link to clipboard 
Print this post

Hi WW

I use Putty all the time on *nix and windows.

To copy text from putty, select the text you want by left dragging the mouse which copies it to the clipboard.

To paste text into putty, right click in the terminal window (pastes at the cursor, not the mouse pointer).

If you want to copy and paste back into a putty window (i.e. to copy an earlier command), left drag and then right click.

hthEdited by CaptainBoing 2018-09-08
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 09:26am 07 Sep 2018
Copy link to clipboard 
Print this post

@CaptainBoing

On RPi PuTTY, currently the Right-Click simply draws a white highlighted line at the point of the mouse cursor.
Nothing appears at the text cursor, and nothing seems to be on the clipboard when LeftClick dragging.

Ctrl-C from another app and then Right-Click in PuTTY does nothing either (apart from white highlighted line at cursor position).

Is there a Mouse setting somewhere 'deep' in a system file that possibly needs to be modified? (as there is nothing in the PuTTY options)
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 09:54am 07 Sep 2018
Copy link to clipboard 
Print this post

Oh, ok. I sent that last post after testing with (one of several) open putty sessions BUT it is on a windows machine. I don't have access to a linux box just now but will try later.

I have copied from/to sessions on linux boxes but now I am questioning how I did it.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 09:59am 07 Sep 2018
Copy link to clipboard 
Print this post

Thanks CaptainBoing

The closest success I have is Ctrl-INS to copy, and Shift-INS to paste.

However, in the MM Editors screen (F4 from command prompt), I only get one line inserted. Not sure if Geoff is doing some logic at the CR/LF stage which then prevents the other lines being inserted.

This is all part of a new 'TermMite' project I am working on; so to be able to solve this will open up a nice feature for controlling a building full of 'remote' MMs

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 10:00am 07 Sep 2018
Copy link to clipboard 
Print this post

WW,
I think the micromite expect CRLF and you are only sending LF

There might be some setting to control the line-endings.

I do a lot of cursing when I swap from micromites to Linux boxes when I am using Teraterm. Fortunately, in TT it is easy to change the line-ending setting.

Jim
VK7JH
MMedit
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 10:07am 07 Sep 2018
Copy link to clipboard 
Print this post

Hi Jim,

Thanks. I think I can force a CR on an LF so will go try that . . . .
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 12:07pm 07 Sep 2018
Copy link to clipboard 
Print this post

to be honest, I don't really use the inbuilt editor for much more than tweaks. My two tools always open are putty & notepad++. All major editing is done in npp the it's ctrl-A, ctrl-C flip to putty, F10 right click and ctrl-Z. Got it down to a few seconds of finger twisting

I like it this way because the running program doesn't just exist in the MM and I have an automatic backup of my work (courtesy of npp) and I have the bare minimum of dependancy on tools... any old editor and any old terminal emulator will do.

I am such a dinosaur Edited by CaptainBoing 2018-09-08
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 04:24pm 07 Sep 2018
Copy link to clipboard 
Print this post

  CaptainBoing said   ... All major editing is done in npp the it's ctrl-A, ctrl-C flip to putty, F10 right click and ctrl-Z.


Just working out what F10 and Ctrl-Z do.

I will try NPP (assuming it is available for RPi?)

So close; but yet so far . . . .

 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 09:45pm 07 Sep 2018
Copy link to clipboard 
Print this post

F10 is AUTOSAVE and crtl-z is the end of file char (26?) which finishes autosave and commits the "paste" to flash
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 04:16pm 08 Sep 2018
Copy link to clipboard 
Print this post

hi,
if you're trying to paste into the internal micromite editor, you'll strike all kinds of grief! the algorithm i use is basically 15mS between characters, and wait for 300mS of silence after sending a <CR>. the editor sends quite a few escape sequences back between keypresses, and i use these to tell if pasting into the editor or not.

when dealing with AUTOSAVE, the safest approach is to send out <CR> delimited lines, and wait for the <LF> response coming back. both <CR> and <CR><LF> delimited lines are handled correctly. even <LF> delimited lines are handled, although the echo back to the console isn't right.

HOWEVER, i've just discovered that <LF> delimited lines are processed much faster, like 10 seconds to upload a 42k file! my suspicion is a possible bug in the microchip library routine UARTTransmitterIsReady() that is causing it to delay returning ready for far longer than it should.

this might be one for peter mather to comment on.


cheers,
rob :-)
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 07:24am 12 Sep 2018
Copy link to clipboard 
Print this post

@CaptainBoing, anyone

The Paste into PuTTY worked as needed; i.e. F10 at command prompt (AUTOSAVE), Shift-Ins (paste), Ctrl-Z (terminate).

Now to find a way to 'reverse' this from the micromite EDITor back into Text Editor.

You'd think that Copy from EDITor, and Paste would work but it doesn't! It is as if the PuTTY clipboard is independent of the RPi generic clipboard.
I use Ctrl-Ins within PuTTY to put on clipboard (and can confirm it is there by pasting itself (Shift-Ins) back into PuTTY, but using Paste in Text Editor does not work (it just pastes whatever is in the RPi generic clipboard).

What I thought would be such an easy thing is turning out really tricky. At least CaptainBoing got me half way there.

Anyone out there with any ideas ? . . .
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1003
Posted: 08:12am 12 Sep 2018
Copy link to clipboard 
Print this post

Do you do a
LIST ALL
to see the whole code and then copy that?
What is the editor you are using and does the RPi use a mouse?

Latest F4 Latest H7 FotS
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 08:51am 12 Sep 2018
Copy link to clipboard 
Print this post

If I need to snag the program from a mite, I do it again with putty by setting the scroll back to something big (3000 lines), clearing everything (Window menu > All Clear Function) then doing a LIST ALL, copy it (Window menu > Copy All to Clipboard) then paste into my favourite editor (notepad++) and remove the fluff top n bottom.

hth
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 09:30am 12 Sep 2018
Copy link to clipboard 
Print this post

  disco4now said   Do you do a
LIST ALL
to see the whole code and then copy that?
What is the editor you are using and does the RPi use a mouse?


Small programs I was trying to Copy from the micromite's EDITor. However, larger programs I was copying from LIST ALL at command prompt. But because neither was actually appearing to be Copying onto the clipboard, I was focussed on just getting a small program going first from within the EDITor.

Editor on RPi is the Raspbian built in Text Editor (under 'Accessories' menu).

RPi has a mouse (actually a TrackPad on a Logitech K400+ keyboard).
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 09:35am 12 Sep 2018
Copy link to clipboard 
Print this post

  CaptainBoing said  . . .then doing a LIST ALL, copy it (Window menu > Copy All to Clipboard)


@CaptainBoing

This just isn't working on a RPi. Just does not go onto the 'generic' clipboard. Its as if PuTTY's clipboard is unique to itself on a RPi

Would you be able to try on a RPi to make sure it is not me going mad!!

WW
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 09:51am 12 Sep 2018
Copy link to clipboard 
Print this post

sorry WW, I don't have a RPi - never went down that route.

This is an old post but it seems you are not alone https://www.raspberrypi.org/forums/viewtopic.php?t=117438
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025