qute-lastpass: invoke fake-key for each string, not per character

This commit is contained in:
Wayne Cheng 2020-07-19 18:08:49 -04:00
parent 2abfb5d205
commit 2f9b3f5ab8
1 changed files with 5 additions and 2 deletions

View File

@ -90,6 +90,7 @@ def pass_(domain, encoding):
return candidates, err
def dmenu(items, invocation, encoding):
command = shlex.split(invocation)
process = subprocess.run(command, input='\n'.join(
@ -98,10 +99,12 @@ def dmenu(items, invocation, encoding):
def fake_key_raw(text):
sequence = ''
for character in text:
# Escape all characters by default, space requires special handling
sequence = '" "' if character == ' ' else '\{}'.format(character)
qute_command('fake-key {}'.format(sequence))
sequence = sequence + ('" "' if character == ' ' else '\\{}'.format(character))
qute_command('fake-key {}'.format(sequence))
def main(arguments):