i hate when this happens

888 points · 79 comments · view on lemmy.world

79 Comments

coldhotman@nrsk.no · 96 pts · 3y (7 replies)
[ removed ]
baseless_discourse@mander.xyz · 32 pts · 3y (5 replies)

Actually, most linux terminal allows you to change shortcut in terminal to just use ctrl-c and ctrl-v.

entropicdrift@lemmy.sdf.org · 60 pts · 3y (2 replies)

The one I use just wants me to do ctrl+shift+v

baseless_discourse@mander.xyz · 6 pts · 3y (1 reply)

By default, yes, but most terminal allow you to just open the setting and change the keybinding. And even Ctrl-c will work as you expect, it will copy when text is selected, and terminate command otherwise.

whyNotSquirrel@sh.itjust.works · 6 pts · 3y

Ctrl+shift+v is paste without formatting in most apps though, so kind of a good habit

drew_belloc@programming.dev · 16 pts · 3y

If i knew it before, now my brain just knows that it need to press shift on the terminal

coldhotman@nrsk.no · 4 pts · 3y
[ removed ]
i_am_hiding@aussie.zone · 8 pts · 3y

We have the middle-mouse-button clipboard for this.

MrMonkey@lemm.ee · 89 pts · 3y (5 replies)

Works the same as M-b for me (backwards-word)

Make sure your /etc/inputrc or ~/.inputrc contains

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving

"\e[1;5C": forward-word

"\e[1;5D": backward-word

"\e[5C": forward-word

"\e[5D": backward-word

"\e\e[C": forward-word

"\e\e[D": backward-word`
lemann@lemmy.one · 23 pts · 3y (1 reply)

Lemmy:

> meme with problem

> SolutionCommentMemeCommentCommentMemeQuestion

Others:

> meme with problem

> BotCommentCommentAwardsAwardsBotShitpostAwardsShitpost

I hope the formatting shows properly... And thanks for this 😁 now to update the .inputrc on my laptop and VPSes

Edit: fix typo and formatting

4am@lemmy.world · 6 pts · 3y

It would have been funnier if you put in “\e;D5c1-7” or whatever the fuck VT-100 gobbledegook

bisq@lemmy.world · 7 pts · 3y (2 replies)

Commenting to save. Thank you!

angrymouse@lemmy.world · 18 pts · 3y (1 reply)

Idk if you know but you van actually save a post or comment pressing the button "save" under it. It will appear in your profile in a section of saved stuff.

bisq@lemmy.world · 3 pts · 3y

Didn’t know that. My lemmy app doesn’t have a comment save button.

abraham_linksys@sh.itjust.works · 83 pts · 3y (6 replies)

Ctrl+a - go to beginning of line (alpha? I dunno)

ctrl+e - go to (e)nd of the line

alt+f - (f)orward one word

alt+b - (b)ack one word

You might already know these but no one else has posted them on this thread yet. I work in both Linux and Mac a lot and this works for them. No idea about Windows I'm no longer forced to use it at work 🙂

NaiveBayesian@programming.dev · 15 pts · 3y (1 reply)

Also Ctrl + w to delete one word backwards (which is what OP wants to do).

Edit: Nvm I misread the post, deleting is not what OP wants to do. Still gonna keep this because Ctrl + w is easily the readline shortcut I use the most.

FUsername@feddit.de · 5 pts · 3y

While we're at it: Alt+d deletes the next word.

dot20@lemmy.world · 11 pts · 3y (2 replies)

If you use WSL (which you should), you have a normal Bash, so it works

abraham_linksys@sh.itjust.works · 22 pts · 3y (1 reply)

The best part of Windows is the part that isn't Windows lmao lawd I'm glad I don't work for the federal government (exclusively Microsoft) anymore

darcy@sh.itjust.works · 3 pts · 3y

fed detected

somedaysoon@lemmy.world · 6 pts · 3y
[ removed ]
debil@lemmy.world · 37 pts · 3y (3 replies)

In a sane editor just press b.

nailbar@sopuli.xyz · 7 pts · 3y (2 replies)

Is Ctrl + ⬅️ for typing 'b' then?

debil@lemmy.world · 5 pts · 3y (1 reply)

No (although you can easily create such a key mapping if so inclined). To type b character one must first enter the so called Insert mode. Depending on where exactly you wish to type the character, you can enter the Insert mode by typing for example i, a, I, A, o or O.

nailbar@sopuli.xyz · 5 pts · 3y

It wasn't a serious question 🙂

Sounds like you're talking about good old vi or vim.

maeries@feddit.de · 27 pts · 3y (3 replies)

Why is that actually?

Anticorp@lemmy.ml · 29 pts · 3y

Because fuck you! That's why!

Edit: serious answer, I'm pretty sure it's outputting the key events to the terminal line.

gornius@lemmy.world · 26 pts · 3y (1 reply)

Because terminal emulators are literally the old terminal emulators (ye oldy screens + keyboard combos that looked like a computer but were just IO) and everything modern they do is just a hack.

grue@lemmy.world · 17 pts · 3y

Terminals with screens? What's all that newfangled shit?

Nah, whippersnapper, this tech goes all the way back to teletypes. You didn't get a fancy-shmancy "screen;" instead, it printed out the results of your commands. On actual paper!


Seriously though, that's why the device files for terminals in Linux are named tty[$NUM] -- "tty" is shorthand for "TeleTYpe."

I believe it's also why really primitive programs can't scroll up and do things like writing an entire screen worth of content in order to emulate interactivity (as opposed to seeking the cursor backwards and replacing only the parts the program wants to replace): they're using a version of the control protocol so primitive that it didn't have a function to go backwards because teletypes didn't need it due to physical impossibility. (That's my theory, anyway -- I haven't dug deep enough into the guts of TERMCAP etc. to be sure. I'm also not actually old enough to have experienced that stuff, despite my joke above.)


Edit: look at this excerpt from man terminfo(5), for instance:

Basic Capabilities
The number of columns on each line for the terminal is given by
the cols numeric capability.  If the terminal is a CRT, then the
number of lines on the screen is given by the lines capability.
If the terminal wraps around to the beginning of the next line
when it reaches the right margin, then it should have the am
capability.  If the terminal can clear its screen, leaving the
cursor in the home position, then this is given by the clear
string capability.  If the terminal overstrikes (rather than
clearing a position when a character is struck over) then it
should have the os capability.  If the terminal is a printing
terminal, with no soft copy unit, give it both hc and os.

To this day, the info database entry for your virtual terminal has to specify that it's capable of deleting a line of text instead of merely striking it out, because some terminals back in the day actually couldn't!

mawkler@lemmy.ml · 25 pts · 3y

b

TimeIntegrated@lemmy.world · 23 pts · 3y (3 replies)
[ removed ]
stratoscaster@lemmy.zip · 14 pts · 3y (1 reply)

It also works with Shift so you can highlight and select words at a time.

Enpeze@lemmy.dbzer0.com · 7 pts · 3y

Hey, I actually knew that shortcut! But it never occurred to me that ctrl+arrow just moves the cursor without selecting anything.

wild stuff.

towerful@programming.dev · 13 pts · 3y

Ctrl+backspace to delete previous word.
Ctrl+delete to delete next work.

nayminlwin@lemmy.ml · 22 pts · 3y

What happens to me is the opposite. I got used to Ctrl+w to delete a word in terminal and accidentally closed browser tabs many times while typing in them.

jordanlund@lemmy.one · 16 pts · 3y (1 reply)

In any sane editor:

Save a file - CRTL-S

In VI:

  1. Switch to command mode by pressing the Esc key.

  2. Type : (colon). This will open the prompt bar in the bottom left corner of the window.

  3. Type w after the colon and hit Enter.

In Emacs:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Save-Commands.html

C-x C-s Save the current buffer to its file (save-buffer).

C-x s Save any or all buffers to their files (save-some-buffers).

M-~ Forget that the current buffer has been changed (not-modified). With prefix argument (C-u), mark the current buffer as changed.

C-x C-w Save the current buffer with a specified file name (write-file).

M-x set-visited-file-name Change the file name under which the current buffer will be saved.

When you wish to save the file and make your changes permanent, type C-x C-s (save-buffer). After saving is finished, C-x C-s displays a message like this:

Wrote /u/rms/gnu/gnu.tasks

If the current buffer is not modified (no changes have been made in it since the buffer was created or last saved), saving is not really done, because it would have no effect. Instead, C-x C-s displays a message like this in the echo area:

(No changes need to be saved) With a prefix argument, C-u C-x C-s, Emacs also marks the buffer to be backed up when the next save is done. See Backup Files.

The command C-x s (save-some-buffers) offers to save any or all modified buffers. It asks you what to do with each buffer. The possible responses are analogous to those of query-replace:

y SPC Save this buffer and ask about the rest of the buffers.

n DEL Don’t save this buffer, but ask about the rest of the buffers.

! Save this buffer and all the rest with no more questions.

q RET Terminate save-some-buffers without any more saving.

. Save this buffer, then exit save-some-buffers without even asking about other buffers.

C-r View the buffer that you are currently being asked about. When you exit View mode, you get back to save-some-buffers, which asks the question again.

C-f Exit save-some-buffers and visit the buffer that you are currently being asked about.

d Diff the buffer against its corresponding file, so you can see what changes you would be saving. This calls the command diff-buffer-with-file (see Comparing Files).

C-h Display a help message about these options.

RocksForBrains@lemm.ee · 3 pts · 3y

wtf m8

feifei@feddit.de · 16 pts · 3y (6 replies)

Also in some Windows programs. Infuriating

TWeaK@lemm.ee · 15 pts · 3y (5 replies)

More often it's Ctrl + backspace that doesn't work. Ctrl + <- works nearly everywhere.

ralC@lemmy.fmhy.ml · 13 pts · 3y

Getting the little boxes when renaming files. Uuuuuuuuggghhh

playxdestroy@lemmy.ml · 7 pts · 3y (3 replies)

i’ve noticed ctrl + backspace works in windows 11 where it didn’t work in 10

TWeaK@lemm.ee · 5 pts · 3y (2 replies)

I hope you don't expect that to convince me to upgrade. That doesn't even make up for what they did to the taskbar.

Kryomaani@sopuli.xyz · 2 pts · 3y (1 reply)

They've since updated it to allow you to display labels & not condense multiple windows into one button so it's better than ever. I can't believe it took until 11 to center the items, left aligning was a literal pain in the neck especially on ultrawide screens.

TWeaK@lemm.ee · 1 pts · 3y

I prefer the left alignment, but I'm glad to hear they finally fixed the combined button thing. I still won't stand for the right click menus and general fuckery with settings pages and keyboard shortcuts.

james@lurk.fun · 13 pts · 3y

set -o vi

s0phia@lemmy.world · 11 pts · 3y

Idk about bash but at least in fish I can do alt + arrows to move the cursor by word, also alt + backspace works to delete whole words.

Dohnakun@lemmy.fmhy.ml · 11 pts · 3y (2 replies)

Depends on the terminal. xfce4-terminal it works.

WhiskyTangoFoxtrot@lemmy.world · 3 pts · 3y (1 reply)

Works in the Cinnamon terminal, too.

Nemoder@lemmy.ml · 1 pts · 3y

And it works in QTerminal.

chaorace@lemmy.sdf.org · 9 pts · 3y (6 replies)

That's why my terminal is emacs

SanndyTheManndy@lemmy.world · 10 pts · 3y (1 reply)

I think you mean OS

Rootiest@lemmy.world · 13 pts · 3y

That's why my terminal is OS

grue@lemmy.world · 6 pts · 3y (3 replies)

Emacs and bash use the same navigation shortcuts though, LOL.

chaorace@lemmy.sdf.org · 16 pts · 3y

Bold of you to assume that an Emacs user will have anything remotely resembling the default keymap by the time they're proud enough to brag about it

Vegoon@feddit.de · 2 pts · 3y (1 reply)

set -o vi

sLLiK@lemmy.ml · 1 pts · 3y

This. Esc, then b. Or if you're a stickler for keeping you hands on home row, Ctrl [ does the trick as well. Bonus points for making that more comfortable via a remapping of Caps Lock to control (or swapping the two).

priapus@sh.itjust.works · 6 pts · 3y

I've never used a distro that didn't come with a sane default shell config to avoid this

korthrun@lemmy.sdf.org · 5 pts · 3y

✨🌈 R E A D L I N E 🌈✨

AnActualFossil@kbin.social · 5 pts · 3y

Alt-B usually works fairly reliably

binwiederhier@discuss.ntfy.sh · 3 pts · 3y

You can type reset to fix your terminal if it gets messed up like that.

Ascend910@lemmy.ml · 3 pts · 3y (10 replies)

Does anyone know how to fix it in bash?

Raphael@lemmy.world · 9 pts · 3y (5 replies)

apt install fish

https://fishshell.com/

Ascend910@lemmy.ml · 6 pts · 3y

You didn't read my comment properly :(

iusearchbtw@lemmy.sdf.org · 2 pts · 3y (1 reply)

fish is nice but the nonstandard syntax gets really annoying after a while. I use ble.sh these days.

Raphael@lemmy.world · 0 pts · 3y

I have no such weakness because I never learned bash syntax anyway.

maess@feddit.de · 2 pts · 3y

so this is why I can't relate to the meme

Ascend910@lemmy.ml · 1 pts · 3y
[ removed ]
xthexder@l.sw0.com · 4 pts · 3y (2 replies)

Why is your user flagged as a bot account? You certainly aren't behaving like a bot.

Ascend910@lemmy.ml · 1 pts · 3y (1 reply)

Maybe it's because I join and in a few day I create several communities and commented into too much. I am just trying to replace Reddit lol

xthexder@l.sw0.com · 1 pts · 3y

There's a "Bot Account" checkbox in your user profile settings. You should be able to just deselect it, and you'll be a normal user.

iusearchbtw@lemmy.sdf.org · 1 pts · 3y

It works for me, which terminal are you using?

AlexWIWA@lemmy.ml · 3 pts · 3y

Mind bogglingly infuriating

thurstylark@lemm.ee · 2 pts · 3y

readline vim mode would like to have a word...

nayminlwin@lemmy.ml · 2 pts · 3y

What happens to me is the opposite. I got used to Ctrl+w to delete a word in terminal and accidentally closed browser tabs many times while typing in them.

jbrains@sh.itjust.works · 1 pts · 3y

Train yourself to use edit-and-execute and this problem disappears forever. Now I'm annoyed when I type "esc v v" and nothing happens.