6 ms·
TIL Alt-clicking in the Terminal prompt lets me move the cursor to that position. How had I not discovered this over many years?
by weiming 6y ago
TIL Alt-clicking in the Terminal prompt lets me move the cursor to that position. How had I not discovered this over many years?
- shrimp_emoji 6y agoWhich terminal? In Linux, Alt+Left Click is the "move window around" idiom, while Alt+Right Click is "resize window with the mouse".
- zimpenfish 6y agoI'd imagine it was Terminal on MacOS from the capitalisation (and that does what he says, just checked.)
- weiming 6y agoYes. That would be Mac iTerm/Terminal, should have mentioned.
- akiselev 6y agoDo people usually use "Alt" to describe the Option key on Macs? I was really confused for a second trying to find it on my Macbook
- OJFord 6y agoYes. Anyone that hasn't been exclusively using macOS for their entire digital life, or at least years, anyway. 'Command' (resp. 'Windows', resp. 'Super') is a different story. You can't say 'Super' with a straight face without also marking yourself out as someone who borders on saying 'GNU with Linux', or 'I run Arch'. (For what it's worth, I do run Arch. ;)) IIRC Option is dually labelled as Alt on some Apple keyboards anyway.
- franga2000 6y ago> You can't say 'Super' with a straight face without also marking yourself out as someone who borders on saying 'GNU with Linux', or 'I run Arch'. Since basically nobody knows the historical difference these days, I just call it the Meta key to avoid the above situation. When non-techy people ask me what the hell I mean, I just explain that's the technical term for the key and that I use it so both Mac and Windows people understand me. I've even heard one of them start using the term themselves, presumably to appear smarter in front of their boss.
- Zarel 6y agoWhile it's not wrong to refer to the Super key as "Meta", I don't like calling it that, because in some contexts (like emacs), "Meta" means the Alt key.
- deleted 6y ago[deleted]
- vangelis 6y agoI use a USB mechanical keyboard with my Mac, Ubuntu at home, so I tend to think of command and option as super and alt.
- tommyage 6y agoHow can you know that this is a common idiom? Is there an (prob. GNU)-document for these things? Two reasons I am asking: 1) I feel terrible reading this, since my last post was preaching for XCFE for this exact functionality. 2) It would be awesome to have these things bundled and discover many things which are yet not discovered by me.
- nougatbyte 6y agoDont think that its a standart of some kind, but KDE does the same thing
- fiddlerwoaroof 6y agoThe major Linux desktops have had this sort of thing for like 15 years. It’s usually only discovered by people who obsessively tweak their settings, though.
- 1998v2 6y agoI want this badly on gnome-terminal. If anyone has this type if thing on a linux plz. advise.
- jchook 6y agoI agree, but also can recommend a few good shortcuts... <c-a> = go to beginning of line <c-e> = go to end of line !! = repeat last command <esc> b = move "back" one word (also <c-b> and <c-left>) <esc> f = move "forward" one word (also <c-f> and <c-right>) Many others exist. See `man bash` under READLINE.
- dylan604 6y ago!cmd = repeat last usage of that command !!enter which is 3 buttons where as up-arrow enter is the same thing.
- Something1234 6y ago!! is more useful than you think. It's substitute last command here, not just up-arrow enter. See sudo !!.
- rtpg 6y agoBy the way, recently discovered you can get some of these shortcuts in all input boxes by activating “emacs shortcuts” inside of gnome-tweaks! Was one of the final blockers for getting me from Mac to Linux
- chrisweekly 6y agoYes! I use c-u to clear the line all the time.
- neetfreek 6y agoAnd <c-w> clears the previous word :) Also <c-y> pastes the line/word back in (so you cant think of it like cut-copy).
- 6y ago
- crazygringo 6y agoNot having this has been my #1 Terminal frustration for years... and it's been there this whole time?!?! This type of thing has actually happened to me several times in the past year or so, where I'd be frustrated an obviously good feature doesn't exist, I'd Google it to see if other people complain about the same thing... only to find it exists after all. There needs to be a word for this...
- Kaiyou 6y agoThere's an initialism for it, used by the people who know about the feature to describe the people who didn't: RTFM.
- crazygringo 6y agoVery funny. If I read the manual for everything I've ever used, I'm not sure I'd have time to actually accomplish anything in the end. Sure, let me spend a day reading through the lists of keyboard/mouse shortcuts for every piece of software I use just to see if there's anything useful in there? No thanks... Good UX would pop up a balloon informing me of the feature after the first time I held down my left-arrow key for more than, say, keypresses.
- tylerl 6y agoAs someone who actually DOES read the manual for everything, your objection about accomplishing nothing is BS. It's a bit of an upfront investment, but you long term efficiency is dramatically higher. You have time to post comments on HN, you have time to read the damn manual. But as someone who also designs UX, I never design anything that requires instructions. There are plenty of good ways to make things self-explanatory. It's just harder. However, command line UX is different. You can make the basics self explanatory, but you're so limited in your options that exposing the advanced stuff intuitively muddies everything else. So there's a trade-off you have to live with.
- abiogenesis 6y ago
- noisy_boy 6y agoI tried this in vim but didn't work. TIL "set mouse=a" enables moving cursor by mouse click in vim.
- wabain 6y agoTo add what was an essential follow-up for me when I discovered this: Once you’ve enabled mouse=a, use the alt key to select text in vim for your system clipboard, rather than vim’s visual mode.
- wazoox 6y agoI don't understand this part. How do you select using Alt? Typically with mouse enabled, you can select text with the mouse, but this doesn't go to the X clipboard. While with mouse disabled, text selected with the mouse goes to the X clipboard.
- wabain 6y agoWhat I had meant was that when using vim configured with mouse=a, selecting with the mouse while holding down the Alt key would disable the terminal emulator's mouse reporting and allow the selection to be copied to the system clipboard. But actually this depends entirely on the terminal emulator. The Alt/Option key works with the default preferences for iTerm2 on MacOS, but with GNOME terminal I reproduced the same behavior using Shift instead.
- noisy_boy 6y agoFound another interesting problem. mouse=a works great on my Ubuntu laptop; however, it has no impact when connected to Linux servers via Putty - when I click somewhere in the vim window, the cursor doesn't jump to that spot.
- wabain 6y agoYou might need something beyond mouse=a to get Putty to report the mouse through to vim—maybe this option? https://superuser.com/questions/513014/moving-cursor-in-putty-with-mouse-click#answer-517166 https://superuser.com/questions/513014/moving-cursor-in-putt...
- hank_z 6y agowow, this is very handy.