How to remap clear buffer to delete all lines in Iterm2

iterm2

I would like to map the CMD K (clear buffer) keyboard shortcut to use CTRL L (delete all lines).

I have tried sending txt (ex: clear) or hex values, but it only pastes the text in the buffer and I still have to hit the Enter button.

Is there a way to do this?

Best Answer

Select Send Hex Code and enter 0x230c which is CTRL + L.

Screenshot for sending CTRL+L when pressing CMD+K

Related Question