Add a New Comment (Rich Markup)
( Jump to the original submission )
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.
So at the moment only Shift-Insert = paste can easily be implemented via .inputrc
> 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.
Maybe you could define readline keybindings in your ~/.inputrc file to do what you want?
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.
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.
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?
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
(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
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 project members can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 5 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11