If you’re hitting escape in the Proxmox noVNC console and it keeps kicking you out, that’s the default behavior — and it’s a dumb default when you’re just trying to exit insert mode in vim. The top search results are full of old config options that don’t exist anymore or browser extensions you shouldn’t need. Here’s what actually works right now.

Why the escape key closes your session
noVNC grabs the escape key to let you break out of the console and go back to the Proxmox UI. That’s fine if you never use escape inside the VM, but if you’re editing a file or using any terminal app that relies on escape sequences, it’s a constant annoyance. The old fix was to set noVNC.escapeKey in some config file, but that’s been gone for a while — the current builds don’t honor it.
The fix that works: remap it in noVNC’s settings
Proxmox’s noVNC build has a built-in way to change the escape key. When you’re in the console, look for the noVNC toolbar on the left side — it’s that little tab that expands. Click the gear icon, then go to the “Keyboard” tab. You’ll see a field labeled “Escape key”. Just change it from Escape to something you’ll never hit by accident, like F12 or ScrollLock. That’s it. No config file edits, no browser extensions.

If you’d rather just disable the escape key entirely
Sometimes remapping isn’t enough — maybe you want escape to work normally in the guest and never close the console. You can override the default behavior with a tiny JavaScript snippet. Open your browser’s developer console (F12) while the noVNC session is active and paste this:
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
e.stopImmediatePropagation();
}
}, true);
That stops the escape key from ever reaching noVNC’s handler, so it stays inside the VM. The downside is you have to do it every time you open the console — not ideal, but it’s a quick workaround if you’re in a pinch.
My take: just remap it and move on
Honestly, the toolbar remap is the way to go. It’s persistent per-session, takes two clicks, and doesn’t mess with anything else. The JavaScript hack is there if you need it, but for most people, changing the key to F12 or something equally obscure solves the problem without overthinking it. This is one of those things that should be easier to find — the docs are a mess on this, and half the forum posts are from 2018. If you’re running a homelab, keep it simple: remap and forget about it.
If you’re dealing with other console annoyances, like LXC TTY login gibberish, I’ve got a fix for that too.