Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
fix: Monkey patch getpass to fix user input (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Sep 2, 2022
1 parent 8b441b3 commit f13d815
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rplugin/python3/gkeep/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ def __init__(self, vim: pynvim.Nvim) -> None:
else:
self._sync = fssync.NoopSync(self._api)
self._start_callbacks: t.List[t.Callable[[], None]] = []
# The keyrings.alt backend will prompt the user for a password when setting up,
# but that will always fail (see https://github.com/stevearc/gkeep.nvim/issues/12)
# Monkey patch it to prompt the user inside of neovim instead.
import getpass

getpass.getpass = lambda msg: vim.call("inputsecret", msg) # type: ignore

@pynvim.shutdown_hook
def on_shutdown(self) -> None:
Expand Down

0 comments on commit f13d815

Please sign in to comment.