Skip to content

Commit

Permalink
feature: auto-ssh if buffer is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Czapliński committed Jun 30, 2021
1 parent b4ed787 commit 7caa291
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xontrib/fzf-widgets.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ def custom_keybindings(bindings, **kw):


if choice:
event.current_buffer.insert_text('ssh ' + choice)
cmd = 'ssh ' + choice
should_eval = event.current_buffer.document.cursor_position == 0
event.current_buffer.insert_text(cmd)
if should_eval:
event.current_buffer.validate_and_handle()
event.cli.renderer.erase()

def _hosts_from_config():
return '\n'.join(
Expand Down

0 comments on commit 7caa291

Please sign in to comment.