Configure gnome-terminal so that right click extends selection rather than displays menu - clipboard

I've been using Linux for a long time, but have only recently 'upgraded' to a full GUI desktop since using it command-line-only for the last three or four years. I used to use 'aterm' before then (with fluxbox, and other old-school things) but I see now that gnome-terminal is pretty usable in Ubuntu's Gnome.
However, there's one thing that really gets me - when you select something and then right click, it doesn't extend the selection, instead it brings up a pop-up menu.
I've been using terminals and emacs for years and right-click has always extended a selection - so there must be some way to configure gnome-terminal to do this. This is a habit I'm not going to be able to grow out of because I use it all the time in emacs.
Does anyone have the magic recipe to restore the behaviour I'm after please?
Alternatively, what's a good and modern alternative to gnome-terminal?
I'm using Ubuntu 10.04.

Try program called terminator.
sudo apt-get install terminator

As #bruce-van-der-kooij rightly pointed out, the answer is to Shift+LeftMouseClick, which extends the selection.

Related

Copy and Paste from Tmux window running inside a terminal on Windows WSL/WSL2

I have been looking for ways to do this for some time: how do I copy text from my Tmux pane - running inside a windows WSL or WSL2 ubuntu (or other linux distro) terminal - to other windows or WSL-Linux applications. I googled this in the past, and I couldn't find a simple solution. I found a ton of complex suggestions none of which worked (and I certainly didn't have the time to turn that into a time consuming project).
How can I instruct .tmux.conf to expose its clipboard to the windows clipboard? I can't believe this is so complicated.
I am not sure if this answer is what you are asking for, as I have faced a similar problem yesterday and still today - and I have come to the conclusion that most probably only those with a demoniac intelligence and a lot of free time on their hands are able to tweak Tmux and achieve the goal elegantly.
Having said this, I have found a workaround that works for me, inspired by how I was able to do copy&paste on MS-DOS terminals in Windows in the past.
A picture is probably worth one thousand words here:
Click on the top left icon, Edit -> Mark, select text to copy.
Press Enter (or Click on the top left icon again and go for Edit -> Copy)
It did the job for me.

vim in Macbook Pro command line doesn't work appropriately

I just switched from a Windows laptop to a Macbook Pro. I have installed vim and macvim using homebrew. Everything works fine with macvim, but in the command line, the vim exhibits weird behaviors.
First, the cursor in the Insert mode (which I suppose should be simply a line) is the same as the Normal mode (which is a rectangle), making it impossible to tell the current mode from the cursor shape. I don't know whether this is normal with vim in the command line because I didn't pay attention before. But this is certainly different from the behavior of macvim and it helps to distinguish the shapes of the cursor in different modes.
Second, the backspace does not work appropriately. It often cannot delete letters in the Insert mode.
I am totally new to OS X, so I would greatly appreciate it if someone can give some hints on how to solve these issues.
Thanks!
Indeed, nothing in your question relates in any way to Mac OS X.
I also like my cursor to change shape when in insert mode, and I use these lines to make it happen in iTerm2:
let &t_SI = "\e[5 q"
let &t_EI = "\e[2 q"
This is a hack, and YMMV depending on which terminal emulator you're using. I suggest googling to find the best solution for your case.
The weird backspace behavior you're experiencing is caused by one of the notorious Vim defaults. Simply set
set backspace=eol,start,indent
to make it work as expected.
I suggest starting with or at least skim through Tim Pope's vim-sensible and save yourself some headaches.
When run in a terminal emulator, Vim has no control over the shape of the cursor. Some hacks exist but they only "work" by chance so I would suggest you get used to it and read :help 'showmode'.
Your backspace issue with a simple option. See :help 'backspace'.

Run terminal inside vim on a macbook?

I searched some old answers on stackoverflow, some of them seem relevant, but none of the solutions work on my macbook (with mountain lion). e.g. The shortcuts mentioned in answers here do not work on my computer: How do I run a terminal inside of Vim?
So I'm wondering if it's because vim on mac/unix is different from a normal linux one. I don't think so, but I'm not sure.
Since I can split the screen with :sp, I'm wondering if it's possible to use one split as terminal and another as the regular vim editor, just like emacs. If so, what's the correct way to do it? (Maybe particularly for mac) If not, it's sad.
Why don't you do things the other way around?
You can use a terminal multiplexer such as Tmux and split a terminal window into two panes using C-b %.
Inside the second pane you can run macvim inside a terminal with $ mvim -v
You can navigate between the two panes with C-b o, (And do much more, but I'll leave it up to you to discover!)
Doing things this way around is much more sane in my opinion, you get the full power of both the terminal and vim without having to hack around with Vim too much (Plus Tmux is very handy for many other uses).
I hope doing things this way around is appealing enough for you!
Having a terminal inside of vim would go against the author's philosophy and design so no: that feature will probably never appear nativelyly in vim.
There are a couple of plugins that more or less work like conqueterm, try them if you really want that feature. Or simply use a separate terminal window like everybody.
You should definitely look at programs like tmux or screen.
But an even simpler solution is to use C-z (which halt vim) to access the terminal and fg to bring back vim into the foreground.

How to map CTRL+Tab in vim Mac OSX Terminal

I'm trying to make Firefox keybindings work for tabs in vim (ssh'd into a server through OSX Terminal), however I'm running into issues.
Its basically the same as this Stack Overflow question except for Terminal in Mac not xterm:
Mapping <C-Tab> in my vimrc fails in Ubuntu
From my research, it seems some terminals don't differentiate between <C+Tab> and <Tab>, so I'm wondering if there's some way to hack around this in the Terminal app so vim can understand it. (Maybe escape sequences or something...)
Any ideas?
Long story short: Ctrl-Tab doesn't exist, because Tab is really already a Control key, Ctrl-i.
Short story longer: There is a way to do it, but it requires a sufficiently large amount of hackery at both the terminal and the vim level that you may or may not consider it worth it. I'm working on a much better more generic solution to it but currently I'm not quite sure the world seems to want it.
http://www.leonerd.org.uk/hacks/fixterms/ if you are interested.
In Terminal.app's preferences, you can set some keybindings to send specific character sequences. In your case, you could set <C-Tab to send gt or whatever Vim shortcut you want.
Anyway, you'd better learn the right shortcuts.

Better windows command line shells [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is there a better windows command line shell other than cmd which has better copy paste between Windows' windows and console windows?
Enable QuickEdit mode, under the Options tab of your shortcut to the command shell. Mark with the mouse, right-click to copy, right-click again to paste.
While you're there, enable a hotkey (like CTRL + ALT + C) for lightning fast access to the shell.
And no, you can't have CTRL + C for COPY, because CTRL + C means BREAK.
On a related note, the Microsoftee who changed the default setting of QuickEdit mode between Windows Server 2000 and 2003 is an idiot and I heap curses upon him each workday.
Windows PowerShell is the obvious choice when it comes to "better windows command line shell other than cmd". Its clipboard handling isn't that much of an improvement - mark with the mouse, Enter to copy, or right mouse click to paste.
This probably is not exactly what you want, but you can take a look at Console2
I have it configured so that shift+select auto copies and middle click pastes, really handy, internally it uses same old cmd.exe so you are not really getting a different shell.
By the way, I guess Ctrl+C = copy is not the best idea in a command line context because it usually means interrupt running process.
Take Command does support Copy/Cut/Paste from the keyboard and the mouse. It's pretty handy if you do a lot of work from a command prompt. It also supports:
Command and folder history, with popup windows to select prior commands or folders.
Screen scroll back buffer
Enhanced batch commands
Built in FTP/HTTP file access
A toolbar with programmable buttons
Note: It's a paid tool, with price of $99.95.
Depending on what you're trying to do with the shell, rxvt in cygwin is good.
You'll get the nicety of auto copy on selection and middle click paste. The biggest downside is that some windows console apps don't play nice with cygwin.
PowerCmd is cheaper than TakeCommand and has a lot of powerful features - not the least of which is better handling of Cut/Copy/Paste. I've only been using it a short time but I'm really impressed so far:
Summary from the site:
PowerCmd enhances your command prompt
with an easy-to-use Windows GUI-style
interface and allows you to run
multiple consoles within a single
tabbed window. You can easily organize
multiple consoles in vertical,
horizontal, and grid forms. Auto-log,
auto-completion, keywords highlight,
configurable font and colors,
customizable toolbar for frequently
used commands or tools and minimizing
to tray are easy solutions to daily
needs. With PowerCmd, you can save and
restore your sessions from last time.
Site:
http://www.powercmd.com/
Features:
http://www.powercmd.com/features.php
Not sure what specifically you mean by better copy/paste but try Take Command.
Take Command supports Shift+Ins for paste and Shift+Del for cut, but apparently nothing for copy, will dig some more.
There are two portion to cmd.exe. First there is the window that pops up for dealing with the text console. I would replace that with ConEmu. That program is actually meant as a wrapper for the Far File manager but works just fine without it. It is very similar to Console2 but also is much more stable and has better features.
Second there is the command line interpreter. I would replace that with Powershell if you actually need any of its features.
I currently run using ConEmu with a batch file to setup my preferred environment. This is kept in my Dropbox folder so it remains synchronized between my computers.
Have you thought through what behavior you want to replace the current Ctrl+C functionality?
Console 2
http://sourceforge.net/projects/console/
http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx
#Chirs
I think you need to clarify shell vs host(emulator). To me it sounds like you need another interface to your existing shell that better supports copy and paste, not another shell that supports more/different features.
I second Pat's suggestion of Console2, it is a very good application and OSS to boot.
The Windows cmd shell, Cygwin Bash, and msysgit Bash shells can be run within Emacs. EmacsW32 provides all three separately. You just have to set the bin directory to use either of the Bash shells. EmacsW32 also provides limited interactions between the Windows clipboard and the top item of the kill ring.
MinGW Shell properly set up with:
right click menu entry
~/.profile file
is well above anything else I have tried.
MinTTY on MinGW/MSYS is nice—nicer than on Cygwin because MinGW/MSYS is faster. Also, if you need cmd.exe behaviour, you can run cmd.exe inside of mintty easily.
See http://code.google.com/p/mintty/.
I use the standard CMD.EXE shell but with a twist: an AutoHotKey script to support clipboard copy-paste as posted in: Keyboard shortcut to paste clipboard content into command prompt window (Win XP)

Resources