bugGNU Octave - Bugs: bug #54056, many editor keys just print escape...

 
 

bug #54056: many editor keys just print escape codes in gui command window

Submitted by:  Lars Kindermann <larskindermann>
Submitted on:  Mon 04 Jun 2018 03:44:55 PM UTC  
 
Category:  GUI Severity:  1 - Wish
Priority:  1 - Later Item Group:  Feature Request
Status:  Postponed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Mon 04 Jun 2018 08:08:05 PM UTC, comment #7:

Readline supports the concept of a "mark", which means you can set a mark at a specific character, then move the cursor, then cut or copy the text between the mark and the cursor point. The text can then be pasted anywhere. The region between the mark and the point is not highlighted in any way.

But fundamentally readline's cut/copy/paste buffer is separate from the system clipboard, so you can't easily cut something with readline and paste it into another program, or vice versa. Octave binds Ctrl+V to paste from the system clipboard in the command window, but that is not related to readline at all. You can highlight with the mouse and copy to the system clipboard, but not to readline's cut buffer.

Mike Miller <mtmiller>
Project Administrator
Mon 04 Jun 2018 08:00:22 PM UTC, comment #6:

So at the moment only Shift-Insert = paste can easily be implemented via .inputrc

Lars Kindermann <larskindermann>
Mon 04 Jun 2018 06:41:15 PM UTC, comment #5:

> Maybe you could define readline keybindings in your ~/.inputrc file to do what you want?


To some extent.

Readline certainly allows you to cut a sequence of characters or words to the cut buffer and paste them somewhere else on the edit line. I often use the defaults of Ctrl+W and Ctrl+Y to cut and paste text on the edit line.

The concepts that are fundamentally incompatible with a terminal emulator are things like selecting a sequence of text with the cursor and copying it or cutting it to the clipboard. Or moving the cursor into previous lines of the terminal output and selecting them for copying to the clipboard. These are edit buffer concepts, not line-oriented terminal concepts, and would require a completely new design for the command window.

Of course you can do these kinds of things by running Octave inside of an Emacs buffer or tmux terminal multiplexer.

Mike Miller <mtmiller>
Project Administrator
Mon 04 Jun 2018 06:33:12 PM UTC, comment #4:

Maybe you could define readline keybindings in your ~/.inputrc file to do what you want?

John W. Eaton <jwe>
Project Administrator
Mon 04 Jun 2018 06:01:56 PM UTC, comment #3:

According to that same Wikipedia page

> CUA never had significant impact on the design of Unix terminal (character-mode) applications, which preceded CUA by more than a decade.


The Octave command window is a terminal-mode entry area, not an editor buffer. Text can be edited with the cursor line-by-line only, and can be deleted, cut, and pasted using standard readline commands, but not like an editor. So it is not expected that these types of interactions will work on the command window as it is implemented now.

It has been discussed earlier whether the command window should be rewritten to no longer be a terminal emulator, but be a text buffer entirely under the control of Qt. That is a much larger undertaking than adding support for some keyboard shortcuts. But supporting these kinds of interactions would be a side-effect of changing the command window from a line-oriented terminal emulator to a text buffer.

Mike Miller <mtmiller>
Project Administrator
Mon 04 Jun 2018 05:48:09 PM UTC, comment #2:

According to the CUA Standard these copy/paste keys should work:
https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description

Shift-Del = Cut
Ctrl-Ins = Copy
Shift-Ins = Paste
Shift-Arrows = Extend Mark

The Octave editor exactly behaves like this.

Lars Kindermann <larskindermann>
Mon 04 Jun 2018 04:36:02 PM UTC, comment #1:

The key combinations that you have listed are not configured by default by Octave's inputrc. So you are seeing the expected behavior. I'm not sure that your expectations are consistent with a normal terminal emulator behavior.

FWIW I have PageUp and PageDown configured to go to beginning of history and end of history, but it is not configured as such in the default /etc/inputrc on my distribution. I never use the Insert key for anything. I don't know what Shift+Delete or Shift+arrow would be expected to do.

Can you describe what you think the behavior of the command window should be?

Mike Miller <mtmiller>
Project Administrator
Mon 04 Jun 2018 03:44:55 PM UTC, original submission:

on Ubuntu 16.04, xfce desktop with german keyboard:

arrow keys, del, pos1, end, ...

work fine, but

insert, shift-insert, shift-del, shift-arrows, pageUp, PageDown, ...

just print some strange chars. So I cannot mark, copy and paste anything without the mouse

Lars Kindermann <larskindermann>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-06-04 mtmiller Priority5 - Normal => 1 - Later
        Item GroupNone => Feature Request
        StatusNeed Info => Postponed
    2018-06-04 mtmiller Severity3 - Normal => 1 - Wish
    2018-06-04 mtmiller StatusNone => Need Info

    Back to the top


    Powered by Savane 3.3