tcsh delete moves mark bug fix

This bug is fixed in tcsh versions 6.14.05 and later.

For the impatient:
Patch for tcsh 6.14.00

I use tcsh as my shell, and I love it. Unfortunately, version 6.14.00 introduced a bug in backward-delete-word, backward-kill-line, yank-pop, and all other editor commands that use c_delbefore() in ed.chared.c.

If the mark is set in the middle of the region that’s deleted, it’s moved to before the start of the deleted region. Specifically, it’s moved backward by the number of characters that were deleted.

To reproduce:

  1. Enter foo barbaz at the prompt.

  2. Move the cursor to the b in baz.

  3. Press Ctrl-Space to set the mark.

  4. Move the cursor to the end of the line.

  5. Press M-^H (Alt-Backspace) to delete barbaz.

The mark will now be on the first o in foo. You can confirm by pressing ^W to kill the region between the cursor and the mark. It will delete the oo, leaving only f.

This patch against tcsh 6.14.00 fixes the bug.

Leave a Reply

Your email address will not be published. Required fields are marked *