Hi Peng,

I don't quite understand this. It seems that tmux makes it more
> complicated than necessary by disable the default behavior of Mac
> Terminal or Linux terminal Is it so? Why not just let them behave as
> what they would do without tmux in the aspect of copying?
>

'tmux' is a terminal multiplexer, i.e. a way to give you access to multiple
terminals within one terminal.  One problem with doing this is that a
single terminal only supports one scrollback history, and is unaware of
screen splits.  So the default behaviour of copy and paste doesn't work in
many cases because when you try to copy text on the screen which includes
some of the scrollback history, the history is mostly likely not part of
the same output.  And if the screen is split in some way, especially
vertically, it will copy text from multiple terminals.

That's the reason why 'tmux' has to provide it's own clipboard and
copy/paste functionality, so it can correctly handle those situations.

Pressing 'shift' while selecting is the easy solution if you want to only
copy a small piece of text which doesn't include any history or other split
panes.  'shift' toggles the mouse between "terminal mode" and "application
mode".  On many terminal clients such as 'putty' for example, you can
reverse the 'shift' behaviour so that the default is reversed.  You may
prefer this.

Basically with 'tmux' we are doing things with terminals that they were not
originally designed for, so some imagination is required.  I hope this
helps explain why it's more complicated than it probably should be.

Regards,

Scott

On Thu, 28 Jan 2021 at 10:20, Peng Yu <pengyu...@gmail.com> wrote:

> On 1/27/21, Sean Hammond <tmux-us...@snhmnd.fastmail.com> wrote:
> > On Tue, 26 Jan 2021, at 4:51 PM, Peng Yu wrote:
> >> I want to have an identical configure file so that it can allow use
> >> highlight text and type command-C (Mac) or ctrl-shift-C (Linux) for
> >> copying. Basically, I just want the normal behavior of a terminal. Could
> >> anybody let me know the tmux code to figure this?
> >
> > You might find this guide useful:
>
> I don't quite understand this. It seems that tmux makes it more
> complicated than necessary by disable the default behavior of Mac
> Terminal or Linux terminal Is it so? Why not just let them behave as
> what they would do without tmux in the aspect of copying?
>
> I don't think it is a good idea to make it so difficult to just get
> back the default behavior of terminals. Any simpler solutions
> available?
>
> > https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/
> >
> > It uses the tmux-yank plugin to achieve the cross-platform behaviour.
> >
> > Also see my tmux config:
> >
> > https://github.com/seanh/tmux
> >
> > This doesn't bind command-c on mac. But this is the line that binds
> > control-c on linux, you could add a similar line for mac but using
> command-c
> > and pbcopy:
> >
> > bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
>
>
> --
> Regards,
> Peng
>
> --
> 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/CABrM6wnKnk4z0KdB05g935BsRCDDfdeN%3D36TYjMgfe%2BmUUAPxA%40mail.gmail.com
> .
>

-- 
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/CAAqsAtR5YtYafKy4_G5iknDcyRUmTA12c6KXacUTkkRebZJ6Cw%40mail.gmail.com.

Reply via email to