Terminal mouse button functions

Sorry if this isn’t the correct category for my topic, but it seemed fitting.

Today I noticed that right clicking in the terminal pastes, while middle clicking brings up a contextual menu. I realize that the right-click-to-paste behavior comes from the Windows terminal, so it might make sense to some, but middle clicking for a contextual menu doesn’t. In all other places, right clicking brings up a menu. I propose that we do it that way, and use the middle mouse button for pasting. It will be a little confusing for windows users, but it will be more consistant with the rest of the OS, and it will make sense to users coming from linux (for whom middle-clicking to paste selected text is the default).

I would be willing to make that change if others think it’s okay. Thoughts?

[edit] The change can be made by switching a couple values in PrefHandler.cpp.
The current defaults are:
59 { PREF_PASTE_MBUTTON, “Button 2”},
60 { PREF_SUBMENU_MBUTTON, “Button 3”},
…but, as I said, I think it would be more sane to swap them.

I’ve noticed this too, and I agree.

Actually, this feature comes from Linux. In Windows right-click opens a context menu. I agree that for consistency it would be better to switch the values, but in that case the context menu should have more useful actions like “Paste” and “Select All”. The encoding prefs should move into a submenu or be removed from the context menu (they’re already available in the menu bar, anyway, and not that important to have in the context menu). Feel free to create a new ticket at http://dev.haiku-os.org and attach a patch.

Just to clarify, selecting and middle clicking is the mode of pasting in linux, the right-click pasting comes from things like putty and the windows command prompt.

I like your suggestions, so I’ll see what I can do to that effect. I’m new to all this, so it may take a little while for a patch to appear. We’ll see!

Hmm, I think I saw this with some terminal app. At least, on the real terminal (i.e. the thing before X11 :wink: it works like that, AFAIK. Anyway… :slight_smile:

This would be pretty cool!

Ohh, right, the console mouse. I think that’s correct.

Newer terminal programs for X tend to provide Copy and Paste functions in the context menu controlling the CLIPBOARD selection, the middle click retains its traditional (a quarter century or so) function of pasting the current selection (called PRIMARY).

In xterm and when using the GPM mouse server for the Linux console, by default right click extends the selection.

Since BeOS (and Haiku) don’t have an equivalent of PRIMARY any attempt to clone this behaviour will be somewhat confusing, but moving the context menu to the right button at least makes sense.

Hooray. I did it. :slight_smile:

That was quite the learning process — I am just beginning to learn C, and my knowledge of C++ is somewhere between “I know it exists” and “it’s like C but with classes and stuff.”

Now to figure out how to submit my changes…

[quote=Grackle]Hooray. I did it. :slight_smile:

That was quite the learning process — I am just beginning to learn C, and my knowledge of C++ is somewhere between “I know it exists” and “it’s like C but with classes and stuff.”

Now to figure out how to submit my changes…[/quote]

Nice. I suppose you’ve made the changes within your svn repository checkout? You can create patches by running, for example, “svn diff > ~/context-menu.diff” from the folder that contains the changes. Then, just send us the diff either to the mailing list or better use our ticket tracker and attach that file to a newly created bug report.

Yup, I was working on my svn repo checkout. I asked #haiku before I saw your message, but the answer was the same.

Anyway, here’s the ticket: http://dev.haiku-os.org/ticket/1159

I checked the diff to see if there was any extra crap, which there was. Specifically, it included changes I had done to include the vmware graphics drivers. I ended up running svn diff from the terminal directory, then modifying the pathnames in the output. Obviously, that’s not a very elegant solution. How should I do that in the future?

BTW, thanks for helping me with all this, Waldemar.