From 0dfa20e481edbc582caa29c608195d3a206f21d7 Mon Sep 17 00:00:00 2001
From: John Gehrig <jgehrig@users.noreply.github.com>
Date: Tue, 21 Feb 2023 21:51:46 -0500
Subject: [PATCH] Issue 999: Replace Issue 728 with key remap

Many users find the shift-space and shift-backspace behavior in terminal
frustrating. However, some users still want to map these sequences.

Applying the runtime re-map workaround, since Neovim is unable to fix
this issue upstream. Neovim still does not report `:terminal` mode.

Index: src/gui/runtime/plugin/nvim_gui_shim.vim
--- src/gui/runtime/plugin/nvim_gui_shim.vim.orig
+++ src/gui/runtime/plugin/nvim_gui_shim.vim
@@ -278,3 +278,16 @@ function! s:GuiWindowOpacityCommand(value) abort
   call rpcnotify(0, 'Gui', 'WindowOpacity', a:value)
 endfunction
 command! -nargs=1 GuiWindowOpacity call s:GuiWindowOpacityCommand("<args>")
+
+" Issue 728: Terminal reports ';2u' for key sequences such as <S-Space>
+" Force-mapping keys is a less-than ideal workaround, but it is the only
+" option that appeases everyone. Neovim does not report terminal mode.
+"
+" See issues:
+"  - https://github.com/neovim/neovim/issues/20325
+"  - https://github.com/neovim/neovim/issues/19265
+"  - https://github.com/equalsraf/neovim-qt/issues/999
+tnoremap <S-Space> <Space>
+tnoremap <C-Space> <Space>
+tnoremap <S-Backspace> <BackSpace>
+tnoremap <C-Backspace> <Backspace>
