laktak / extrakto

extrakto for tmux - quickly select, copy/insert/complete text without a mouse
MIT License
878 stars 45 forks source link

Give a config tip about clipboard-less use case in README #37

Closed shippy closed 4 years ago

shippy commented 4 years ago

I use tmux almost exclusively on remote servers. The remote servers rarely have a display running, so xsel/xclip error out. Often, I also don't want to share a clipboard with the tmux session.

My primary use case for extrakto is re-pasting some text into the current command prompt. My muscle memory for fzf makes me hit Enter as often as not, which results in an error instead of a pasted command. I'd prefer Enter to do something useful.

I just spent half an hour figuring out how to do that - remap the "Enter" action? disable clipboard? pray to the forgotten gods? - until I had the embarrassing realization that I could just set the clipboard action to tmux paste-buffer.

I recognize that clipboard-less use might go against extrakto's raison d'être, but I think this is a neat option to provide - and since you already provide it, it might as well be documented.

laktak commented 4 years ago

Ah, I see what you are doing. This is quite a hack though and only works because extrakto does tmux set-buffer -- "$text" internally first.

I find this too confusing because the clip tool is meant to get text via stdin (which paste-buffer does not).

We could create a wiki page though for this use case.

shippy commented 4 years ago

Ah, I see. So this will break if either of the following happens:

  1. extrakto does not set set-buffer -- "$text" in the future, perhaps in an attempt to preserve current buffer content,
  2. in some future tmux version, tmux paste-buffer starts acting differently passed stdin.

Would be happy to write up that wiki page; not sure how to PR that. Any preferred methods?

laktak commented 4 years ago

I updated the settings - can you edit the wiki now? I created a page for you at https://github.com/laktak/extrakto/wiki/Remote-Usage

shippy commented 4 years ago

Yup, there's an edit button now!

laktak commented 4 years ago

I'm going to close this PR. If you have the time please add your hints to the wiki and I'll link them from the README.