DevHeads.net

'Emacs style' delete line shortcut (CTRL/U) doesn't work correctly in Firefox

I have the 'Emacs style' keyboard shortcuts enabled on my [x]ubuntu
18.04 systems. The shortcut I use most often is the (not really
Emacs) CTRL/U for deleting a line of text.

This should delete the whole line of text even if the cursor isn't
placed at the end of the line. It *does* do this in other GUIs but in
Firefox it just deletes from the cursor to the start of the line.
This makes the shortcut much less useful as it means I need to move
the cursor to delete the line and this means I have to use the touchpad
or mouse. The whole point (for me) of CTRL/U is that I don't need to
leave the keyboard to enter a new line.

I'm fairly sure this *used* to work in Firefox. Is it therefore a bug
I can report? .... or is there a workaround, i.e. a simple, keyboard
only, 'delete line' shortcut?

Comments

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By MR ZenWiz at 10/10/2018 - 15:54

On Wed, Oct 10, 2018 at 2:14 AM Chris Green < ... at isbd dot net> wrote:
I have never seen ^U used for anything but 'delete from cursor to
beginning of line.' That's how it works in bash (and every other
UNIX/Linux shell I've ever used), and most line oriented apps (think
vi)

Liam,

I too am a huge keyboard afficionado, and I detest being stuck with
using a mouse (or worse, a touchpad - ick), but i also must say that
I've been less impressed with Windows than Linux re keyboard vs.
mouse. DOS and 4DOS, sure, but Windows? (I'd be more impressed if
they hadn't changed the keyboard commands in Office 2010 or one of the
more recent ones where, among other things, <shift>^S no longer means
"save as".)

For the record, I go back to 1980 professionally, with 2+ years of
intense ICS education before that (plus one class of punch cards and
line printers in 1973 - talk about fun!), and I've used vi since I was
first introduced to it in 1986 or 1987. Back then it was the only
text editor available on all UNIX machines (emacs was still new, and
I've never learned it). I frequently evangelize the huge advantages
of using the command line over anything in the GUI with rare
exceptions, most of which have to do with actually manipulating
graphics. Keyboard power forever!

Mark

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By Chris G at 10/11/2018 - 04:59

On Wed, Oct 10, 2018 at 12:54:49PM -0700, MR ZenWiz wrote:
bind "<ctrl>u" {
"move-cursor" (paragraph-ends, -1, 0)
"delete-from-cursor" (paragraph-ends, 1)

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By Liam Proven at 10/10/2018 - 05:35

On Wed, 10 Oct 2018 at 11:14, Chris Green < ... at isbd dot net> wrote:
That does not follow. Just press END first.

Huh? No you don't.

But you don't.

The CUA way is:

Home, Shift-End, Del

or

End, Shift-Home, Del

or

Ctrl-A, Del

There are probably others.

That should work on all GUIs since the late 1980s: classic MacOS, Mac
OS X, all versions of Windows, all Windows-like Unix desktops, etc.

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By Chris G at 10/10/2018 - 07:16

On Wed, Oct 10, 2018 at 11:35:41AM +0200, Liam Proven wrote:
However they are all two (or even three) keys rather than one so I'd
really like CTRL/U to work.

Ctrl-A, Del is no good because it *selects* the text before deleting
and thus overwites anything I have in the cut buffer. I very
frequently us CTRL/U before pasting something I have copied from
somewhere.

However End, CTRL/U does work so is a reasonable workaround, two keys
a long way apart on my keyboard though!

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By Liam Proven at 10/10/2018 - 07:44

Top tip, if you're concerned about keyboard efficiency: unplug your
mouse for a while. Learn to use your PC without it.

(I'm old. I learned Windows 2.0 this way in 1988 in my first job. My
employers didn't own a PC mouse. If you wanted GUI stuff, you used a
Mac. So I had to learn all the keyboard shortcuts. I had no choice.
But it means colleagues are dazzled by how fast I can navigate a GUI
now, while barely touching the mouse. CUA was rationally designed,
unlike Emacs or Vi. It's easier to learn than either and it's far more
widely used.)

This is one place Windows scores slightly over Linux, and Linux scores
significantly over Macs: keyboard controls. You can do almost
everything with just the keys.

Personally I don't get on with Emacs (or Vi) and don't use them,
because they don't use the standard keyboard shortcuts that all GUI
apps support and have supported since roughly Windows 3 in about 1989.

It's worth learning them, IMHO, because they are far more
widely-supported than Emacs or anything like it.

That's a good point. I use that too.

Hmm. I can't help there. I have big hands and use a big loud old IBM
Model M clicky keyboard. Works for me.

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By Chris G at 10/10/2018 - 09:12

On Wed, Oct 10, 2018 at 01:44:22PM +0200, Liam Proven wrote:

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By Liam Proven at 10/10/2018 - 09:43

On Wed, 10 Oct 2018 at 15:14, Chris Green < ... at isbd dot net> wrote:
Heh! Excellent -- well played! :-D

I'd give you the secret handshake but I've forgotten it.

Fair call.

The thing is, though, that Vi or Emacs style UIs weren't taken up by
many other apps -- e.g. on the DOS playform, Wordstar commands
dominated for a while. (E.g. early releases of DR-DOS had a text
editor that understood Wordstar commands, while MS-DOS still only
offered Edlin.)

There were too many competing standards -- Vi, Emacs, Wordstar, old
Windows keystrokes, old classic MacOS ones, etc.

Which is why CUA came along.

<a href="https://en.wikipedia.org/wiki/IBM_Common_User_Access" title="https://en.wikipedia.org/wiki/IBM_Common_User_Access">https://en.wikipedia.org/wiki/IBM_Common_User_Access</a>

It took the idea of the exceptionally rigorous Apple HIG (Human
Interface Guidelines) and extended them in a more PC-centric way.
Basically _everything_ since then has conformed to them -- Windows and
OS/2 directly, Apple indirectly as it adopted most of them in Mac OS
X, Linux because all the leading desktops are copies of Windows 95 &
its accessories, so accidentally grandfathered in the same UI.

I learned the CUA stuff around 1989-1990 and every editor since then
adopts it by default. I remember a handful of older things --
including Ctrl-U to clear a field -- but happily I've let my muscle
memory of all else fade away since then.

Which is why I don't like Emacs or Vi, despite nearly 30 years of
reluctant Vi usage. They don't conform. But these days I use Tilde
instead, which does and is fine. As a non-programmer I need nothing
more.

Well, fair call. Remembering both might be a bit much for almost anyone...

Re: 'Emacs style' delete line shortcut (CTRL/U) doesn't work cor

By oxy via ubuntu-users at 10/10/2018 - 09:32

10 October 2018 at 14:12, Chris Green wrote:
Re: 'Emacs style' delete line short (at least in part)

Boring Green text, that new fangled White text or the odd Orange text?