95 points

permalink
report
reply
31 points
*

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

permalink
report
parent
reply
60 points

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

permalink
report
parent
reply
6 points

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.

permalink
report
parent
reply
17 points

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

permalink
report
parent
reply
4 points

oh my i didnt know

permalink
report
parent
reply
8 points

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

permalink
report
parent
reply
90 points

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`
permalink
report
reply
23 points
*

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

permalink
report
parent
reply
6 points

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

permalink
report
parent
reply
7 points

Commenting to save. Thank you!

permalink
report
parent
reply
18 points
*

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.

permalink
report
parent
reply
3 points

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

permalink
report
parent
reply
83 points
*

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 🙂

permalink
report
reply
15 points
*

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.

permalink
report
parent
reply
5 points

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

permalink
report
parent
reply
11 points

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

permalink
report
parent
reply
22 points

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

permalink
report
parent
reply
3 points

fed detected

permalink
report
parent
reply
6 points
*
Deleted by creator
permalink
report
parent
reply
37 points

In a sane editor just press b.

permalink
report
reply
7 points

Is Ctrl + ⬅️ for typing ‘b’ then?

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
5 points

It wasn’t a serious question 🙂

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

permalink
report
parent
reply
27 points

Why is that actually?

permalink
report
reply
29 points
*

Because fuck you! That’s why!

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

permalink
report
parent
reply
26 points

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.

permalink
report
parent
reply
17 points
*

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!

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 3.6K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments