Nicholas, I've been using Sceen and it's the same.  But I think you 
misunderstand a little.  I'm not trying to set tmux's off-screen copy 
buffer.  I'm wanting to "repaint" PuTTY's buffer so that it match exactly 
tmux's current selected window + its off screen copy buffer.  

Why?  Because if you flip between windows in tmux, or if you are 
re-attaching, PuTTY's buffer is empty.  If I can refill that buffer, then 
it becomes usable for copy pasting or even if I wanted just to look at it 
without having to go into tmux's edit mode.  It's possible to trivially use 
the mouse to select, copy then paste lines which are off the screen in to 
another local application which you can't do with tmux's copy mode.  It's 
convenient and easy to do this when it works.  Of course, if you have 
multiple panes in a window on tmux, this does not work.

I have a hack which works very well for Screen and I'm just trying to 
reproduce this hack for tmux.

In an ideal world, my ssh client would support OSC-52 setting of the local 
copy buffer but it does not and will never support that.

I'm very close to getting something to work on tmux.  Using capture-pane 
and save-buffer I can write a temp file.  My problem at the moment is 
trying to cat that file back out into the active pane or window.  Is there 
a tmux command which does this?  The reason I need a tmux command is 
because I want to add it to the key binding definition and bind that to say 
ctrl-L.

How would I cat a file into a pane in tmux?  Or how would I target a pane 
with a file?  To be clear, not to the command prompt but to the window 
itself.  I've been searching the tmux man page for this but haven't found a 
command to do this.

On Tuesday, 27 September 2022 at 08:16:20 UTC+1 nicholas wrote:

> There is no mechanism to set the tmux history, the only thing you can do 
> is cat the file with cat which will put it in the history. But I'm not 
> really sure what that will achieve, since that's where it came from anyway?
>
>
>
> On Mon, 26 Sept 2022, 11:32 Michael Grant, wrote:
>
>> Many terminal programs these days such as PuTTY have a scroll bar which 
>> you can scroll up and see lines that scrolled off the screen.  Tmux has an 
>> internal notion of a scrollback buffer for each window as well.
>>
>>  
>>
>> Sometimes (actually quite often!) I need to refresh the lines in my local 
>> scroll buffer with what’s in tmux’s.  For example, if I need to copy-paste 
>> something which is larger than the actual screen size and I’ve just 
>> reattached and my local scroll buffer is empty, or if I’ve changed windows 
>> a few times and disturbed the scroll buffer.
>>
>>  
>>
>> What I have tried (assuming single pane):
>>
>>  
>>
>>     bind-key C-l "select-window; capturep -eJ -S- -E- -b foo; save-buffer 
>> -b foo ~/capture; delete-buffer -b foo"
>>
>>  
>>
>> This nicely captures the entire contents of the pane including color, 
>> witespace, and all in a file named ‘capture’.  But how would I cat that 
>> back into the active window?  
>>
>>  
>>
>> I tried not saving it and adding -p to send it to stdout just
>>
>>  
>>
>>   bind-key C-l "select-window; capturep -eJp -S- -E-;"
>>
>>  
>>
>> This results in an error in the status line: “Can’t write to client”.
>>
>>  
>>
>> Is there some tmux way to “refresh” a window including its scrollback?  
>> Anyone have any workable ideas to make any of the above hacks work?
>>
>>  
>>
>> Michael Grant
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tmux-users+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/ca4a78d5-8d9c-490e-a931-71f4cbcdf784n%40googlegroups.com.

Reply via email to