martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.
MIT License
843 stars 108 forks source link

Send text to other buffer #110

Open cyruseuros opened 4 years ago

cyruseuros commented 4 years ago

Tmux has set-buffer and paste-buffer commands for quickly sending text between windows. I was wondering if something similar was possible with dvtm without going through the editor using copy-mode, even if it means writing a small script to do it.

luke-clifton commented 4 years ago

By modifying the commands field

https://github.com/martanne/dvtm/blob/311a8c0c28296f8f87fb63349e0f3254c7481e14/config.def.h#L193

And using the -c option to create a command fifo, this is possible.

cyruseuros commented 4 years ago

I'm guessing this would be done using the send command? The thing is I'm not exactly sure how to use the selection from a shell script (when I don't actually have anything selected, but have the string I want to send stored as a variable).

Could you post an example of what I would need to echo into the fifo?

GReagle commented 3 years ago

Pasting in dvtm is very easy (Mod, p). I am guessing that you want copying certain text to be easier. In dvtm, you need to use your text editor to select the text that you want because dvtm puts the entire buffer into your editor. It could be very easy or very hard, depending on you and your editor. What editor do you use? I might be able to give you tips on making it easier.

I doubt that dvtm is going to be changed in how it does copying, but you never know.