NStefan002 / screenkey.nvim

Screencast your keys in Neovim
MIT License
291 stars 5 forks source link

Allow blacklisting certain buffers #6

Closed Davidyz closed 4 months ago

Davidyz commented 4 months ago

When opening a terminal buffer inside neovim (I tested with :terminal and toggleterm.nvim) this plugin shows the password for sudo commands. I'm not sure how common it is to run commands with sudo from within neovim, but I believe this is the same kind of security risk that this plugin is trying to solve. It would be nice if we could have an entry in the configuration that does not record the key stroke in certain filetype/filename patterns. (We could write autocmd by ourselves to do this but I think it's worth being added as a default because it will be safer and will help prevent accidental password leak)

NStefan002 commented 4 months ago

Thanks for reporting this, I totally missed it (since I don't use terminal inside of Neovim).

I will fix this as soon as possible.

NStefan002 commented 4 months ago

@Davidyz I added the option for disabling screenkey for specified filetype/buftype. Do you mind testing it when you have time? Be sure to add branch = "main" in your lazy plugin spec (if you're using lazy.nvim).

Davidyz commented 4 months ago

Hi, I just tested commit c678d5f with

opts={
  disable={
    filetypes={ "toggleterm" }
  }
}

and

opts={
  disable={
    buftypes={ "terminal" }
  }
}

and they both hide the key display window correctly. Thanks for the fix! Since the fix is already in the main branch, I'll close this issue now.

NStefan002 commented 4 months ago

Thank you for all the help!