upide icon indicating copy to clipboard operation
upide copied to clipboard

The REPL pane at the bottom does not support ^C/^V

Open maarten-pennings opened this issue 2 years ago • 5 comments

In the editor pane a right click gives hints for hotkeys: ^Z, ^Y and ^X, ^C, ^V and ^A The menu entries work and these hotkeys work.

In the REPL (terminal) pane at the bottom, a right click gives the same menu with same hotkeys. The menu entries work, but these hotkeys do NOT work. I guess they do not work because they are send to the python board (LEGO hub). So, remove the hotkeys listing in the right click menu.

However, I do use those keys a lot, so you could also chose to not send them and keep them locally. (That means you can not send them, so maybe you want a toggle raw/friendly)

Also note, currently, in the REPL I can press ^A, it does not "select all". It executes a lego hub feature:

>>> help()                                                                      
Welcome to MicroPython!                                                         
                                                                                
For online help please visit http://micropython.org/help/.                      
                                                                                
Quick overview of commands for the board:                                       
  hub.info()    -- print some general information                               
  hub.status()  -- print sensor data                                            
                                                                                
Control commands:                                                               
  CTRL-A        -- on a blank line, enter raw REPL mode                         
  CTRL-B        -- on a blank line, enter normal REPL mode                      
  CTRL-C        -- interrupt a running program                                  
  CTRL-D        -- on a blank line, do a soft reset of the board                
  CTRL-E        -- on a blank line, enter paste mode                            
  CTRL-F        -- on a blank line, enter filetransfer mode                     
                                                                                
For further help on a specific object, type help(obj)                           
For a list of available modules, type help('modules')

maarten-pennings avatar Mar 25 '22 21:03 maarten-pennings

I don't think that catching certain keys is a good idea. Also since this is a windows only issue. Under Linux e.g. copy'n paste works without special keys. So catching them would disable them under Linux for no special reason.

Maybe a right-click context menu with copy'n paste is appropriate.

How do other terminal programs deal with ctrl-c and ctrl-v under windows?

harbaum avatar Mar 26 '22 09:03 harbaum

Uhm ... the context menu is already there.

So you want to sacrifice the ability to send ctrl keys to the repl in favor of having two different ways to do copy'n paste? Plus the MicroPython help on most devices even mentions these ctrl keys. The user will then expect these to work.

harbaum avatar Mar 26 '22 12:03 harbaum

No this was foremost a bug report: the context menu is there, but it shows hotkeys that are not working (^Z, ^Y, ^X, ^C, ^V), or doing something else then advertised (^A).

There are two ways to fix the bug: (1) remove the hotkeys from the context menu, or (2) make the hotkeys work.

I realize that (2) is controversial, since the terminal should send all keys to the host. However, I was suggesting that maybe you could sacrifice that.

The selling point of uPIDE, is that it solves all that terminal stuff (^A, ^B, ^C, ^E,^F) in a much more elegant way. I don't need the "paste mode" I have your run (without download). etc. If I use uPIDE, I don't see the MicroPython interface, nor its help. I will use the terminal to do quick tests by copy and pasting code from my program. So ^c/^V would be quicker then mouse-paste. So give that a thought.

Microsoft command shell since win10 accepts ^C and ^V: image

maarten-pennings avatar Mar 26 '22 20:03 maarten-pennings

So there are two places that tell the user contradicting things about the ctrl sequences. That's indeed not nice.

The main problem is probably ctrl-c. It's commonly used to stop a process and it's also commonly used to copy.

harbaum avatar Mar 28 '22 07:03 harbaum

Upper window is fine: there is a right click menu so the mouse works, the shortcut keys are listed , and they work.

Lower window is not OK: there is a right click menu so the mouse works, the shortcut keys are listed , and they do NOT work.

For me the question is what to do in the lower window:

  • send all keys to the host and have the user do special operations (undo, copy, paste, etc) only with the mouse
  • keep some keys local (^z, ^c, ^v, etc) and have mouse functions ("SEND stop process") to send them to the host instead

First one is easy to explain but hard to use (I use ^C/^V much more often then wanting to send a ^A). Second is harder to explain and might be easier in use. But it depends on users' priority.

maarten-pennings avatar Mar 31 '22 20:03 maarten-pennings