Search code examples
macosneovimiterm2

Delete (forward) does not work anymore in Neovim / iTerm2 (macOS)


I think since the last iTerm2 update, the DEL (⌦) key does not work anymore when using Neovim (NVIM v0.10.2).

In normal mode it does nothing and in edit mode it displays the following character: (Arabic Presentation Forms-A (U+FE28)

In the iTerm2 settings, I don't have a special remap for the delete key. I am sure It comes from iTerm2 because when using the standard mac Terminal, it works as before.

I saw several related questions, but a remap of the DEL with the key does not work. Any clue?


Solution

  • I've also been searching for the answer to this question and have tried a few things:

    • set backspace=indent,eol,start in my ~/.vimrc
    • removing all entries about deleting in iTerm2 > Settings > Profiles > Keys
    • trying sending ^H
    • trying sending 0x04 for fn + Delete
    • reapplying Presets... to "Natural Text Editing" and "Terminal.app Compatibility"

    None of these actions fixed the issue for me.

    Then today I found these issues that point at iTerm:

    This code change (that addresses the iTerm issue above) might fix for future versions:

    However, this revision does not appear to have made it into the 3.5.7 stable release:

    I downloaded and tried 3.5.7 locally anyways and it still exhibited the fn+delete issue (only backward deleting not forward) for me.

    These actions did mitigate this issue for me:

    • switch back from iTerm to Terminal (works for me)
    • revert to an older version of iTerm (3.5.5 from https://iterm2.com/downloads.html works for me under Stable Releases > Show Older Versions) and possibly disable updates (Settings > General > Services > Check for updates automatically)

    But just note that it'll probably be fixed in the future so make sure you eventually keep using the latest version of iTerm if you take either of these routes (because it's awesome and the latest versions will be the best / most secure over time).

    Note: I'm on OS X 14.6.1 not 15.