mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.46k stars 194 forks source link

I can't bind the key combination of "Shift-F5" by using <S-F5> to trigger the dap.terminate() function #1113

Closed shaojunjie0912 closed 9 months ago

shaojunjie0912 commented 9 months ago

Debug adapter definition and debug configuration

总览

Debug adapter version

No response

Steps to Reproduce

I add the key mapping to my dap.lua file like this. vim.keymap.set('n', '<S-F5>', function() require('dap').terminate() end) but the key combination didn't work. However, when I use single key like <F6>, it worked properly. 细节

Expected Result

Shift-F5 should have terminated the debugger

Actual Result

Shift-F5 couldn't terminate the debugger, it didn't respond. But F6 could terminate the debugger successfully.

mfussenegger commented 9 months ago

This has nothing to do with nvim-dap, but rather with how terminals and applications communicate key sequences. E.g. see https://unix.stackexchange.com/questions/292460/how-terminal-emulators-handle-shiftfkeys

E.g. when I enter insert mode and hit Ctlr + v followed by Shift + F5 I get <F17>. A keymap with that definition then also works:

vim.keymap.set("n", "<F17>", function() print("Hello") end)