bugGNU Octave - Bugs: bug #39785, C-v paste behavior different in...

 
 

bug #39785: C-v paste behavior different in Unix and Windows GUI terminal windows

Submitter:  John W. Eaton <jwe>
Submitted:  Wed 14 Aug 2013 04:50:33 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  jwe Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 18 Aug 2013 10:21:20 PM UTC, comment #17: 

Looks good to me, thanks.

Mike Miller <mtmiller>
Group Member
Sun 18 Aug 2013 05:40:29 PM UTC, comment #16: 

How about this then? (patch attached)

(file #28869)

John Donoghue <lostbard>
Group Member
Sun 18 Aug 2013 12:59:06 PM UTC, comment #15: 

I was just about to say no. Can we also get a fix to clear the selection on the Unix terminal when new text is typed for consistency? But not when typing keys that don't insert text, such as Shift+PgUp or Shift+PgDown.

Mike Miller <mtmiller>
Group Member
Sun 18 Aug 2013 08:11:56 AM UTC, comment #14: 

For me it now also works the same on Linux. So can this bug be closed?

Philip Nienhuis <philipnienhuis>
Group Member
Fri 16 Aug 2013 10:00:54 PM UTC, comment #13: 

Found the bug report (#39259); I'll close that one.
(It now works OK on WinXP, too.)

Philip Nienhuis <philipnienhuis>
Group Member
Fri 16 Aug 2013 09:18:30 PM UTC, comment #12: 

@John D (comment #7 & #11):

Yep Ctrl-C and Ctlrl-V now work beautifully in the GUI terminal for copy & paste, thanks. Good work!
In addition, Ctrl-C now interrupts long scripts (in the GUI).

Nice collateral effects:

- The "quote doubling" has disappeared at last (single or double quotes were always repeated once and the cursor put behind the extra quote)

- The GUI terminal is now effective from start. Previously I had to click in another pane and then in the terminal to get a cursor and some response there.
I may have filed a bug report for that but I can't find it (hmmm my memory may be hazy).

Philip Nienhuis <philipnienhuis>
Group Member
Fri 16 Aug 2013 12:27:50 PM UTC, comment #11: 

Changeset http://hg.savannah.gnu.org/hgweb/octave/rev/0b2a0acd0315 should have fixed the ctrl C/V issue (13 Aug)

John Donoghue <lostbard>
Group Member
Fri 16 Aug 2013 11:23:47 AM UTC, comment #10: 

@John D, comment #7:

No C-v and C-c don't work here in Octave f Windows, should they?
My latest (MXE) Windows build is from Aug 12 (IIRC), made with MXE-0.03 (I still get stuck with dllwrap errors/OpenBLAS in later MXE).
Tonight I'll try C-v/C-c with an up-to-date build.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 16 Aug 2013 10:19:07 AM UTC, comment #9: 
John Donoghue <lostbard>
Group Member
Thu 15 Aug 2013 11:42:19 PM UTC, comment #8: 

Patch to clear terminal selection on pressing a key/pasting.

(file #28859)

John Donoghue <lostbard>
Group Member
Thu 15 Aug 2013 11:01:31 PM UTC, comment #7: 

Phillip, in regards to https://savannah.gnu.org/bugs/?39785#comment3

Ctrl-C and V are not working for copy paste for you?

John Donoghue <lostbard>
Group Member
Thu 15 Aug 2013 06:09:34 PM UTC, comment #6: 

Thanks for checking again. Now that I think about it, I do seem to remember that Matlab will actually put a cursor in the console area if you click instead of select, as if it were a text area widget, as if you could actually type there. Once you start typing the cursor jumps back to the prompt line. Is that still the case?

You're right about GUIs on Linux, too, I was thinking about terminals (xterm, gnome-terminal, etc) where you can select with the mouse, the cursor remains at the prompt, and you can still input text while keeping previous text selected.

So the right behavior for both platforms should be to clear the selection on any input, whether it's a paste or keyboard input?

Mike Miller <mtmiller>
Group Member
Thu 15 Aug 2013 05:00:40 PM UTC, comment #5: 

In that case ML wipes the selected text. In fact any key press, or left mouse button click, will do that (incl. Ctrl-v)

I think this behavior is valid for the majority of Windows GUI programs (and -as far as my experience goes- many Linux GUI programs too these days)

Philip Nienhuis <philipnienhuis>
Group Member
Thu 15 Aug 2013 12:35:42 PM UTC, comment #4: 

Thanks for checking in Matlab. What does Matlab do with the selection when typing new text at the prompt while text is selected elsewhere in the console area?

Mike Miller <mtmiller>
Group Member
Thu 15 Aug 2013 12:15:08 PM UTC, comment #3: 

Just had a chance to check in Matlab:

Normally in most Windows progs C-v would replace selected text by the text in the clipboard (or other clipboard contents if appropriate).

In the Matlab terminal however, C-v pastes clipboard text at the prompt AND clears selection of text elsewhere in the terminal.
I suppose that is what Matlab users would expect for C-v.

As regards Octave on Windows (GUI mode), C-v, C-x and C-c still don't work (copying to / pasting from the clipboard currently works via a right-click popup menu). So it isn't unexpected that in the Octave terminal this still doesn't work.

In octave-cli.exe (in fact, a cmd32.exe window) the key bindings differ from other Windows GUI programs (<Enter>-key = copy selection, right-click = paste). C-v does clear a text selection, but in fact any key press will do that.

Is this the information you needed?

Philip Nienhuis <philipnienhuis>
Group Member
Thu 15 Aug 2013 03:38:35 AM UTC, comment #2: 

I haven't run the GUI on Windows in a while, but I do see the reported behavior on Linux.

My expectation is that the selection should remain highlighted until the mouse is clicked somewhere in the terminal area. Typing in the terminal area leaves the selection highlighted.

Possibly related: Highlight some text, then press Enter until the text scrolls to the top of the terminal area. It will un-highlight when the text reaches the top line of the terminal.

Mike Miller <mtmiller>
Group Member
Wed 14 Aug 2013 08:51:38 PM UTC, comment #1: 

In almost all Windows programs, incl. Matlab, Ctrl-v = paste clipboard contents. That's what it does in the ML terminal too.

IIRC you once mentioned that Ctrl, Alt and Shift key combinations had better be configurable?

Philip Nienhuis <philipnienhuis>
Group Member
Wed 14 Aug 2013 04:50:33 PM UTC, original submission:  

In the Unix terminal window, C-v will clear the selection while in the Windows terminal window it does not.  It seems to me that it should do the same in both.  What does Matlab do (i.e., what would Matlab users expect)?

John W. Eaton <jwe>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #28869:  unix_clearsel.patch added by lostbard (967B - text/x-patch)
file #28859:  clear_sel.patch added by lostbard (962B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jwe (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-18 lostbard Attached File- Added unix_clearsel.patch, #28869
    2013-08-18 lostbard StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2013-08-15 lostbard Attached File- Added clear_sel.patch, #28859
    2013-08-15 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code