Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only copy a maximum of 57 characters in tmux #13

Closed
zachcheung opened this issue Jan 18, 2024 · 1 comment
Closed

only copy a maximum of 57 characters in tmux #13

zachcheung opened this issue Jan 18, 2024 · 1 comment

Comments

@zachcheung
Copy link
Contributor

$ pbpaste | wc -c
7
$ shcopy 'To use shcopy within a tmux session, make sure that the outer terminal supports OSC 52, and use one of the following options'
$ pbpaste | wc -c
57
$ tmux -V
tmux 3.3a
$ cat ~/.tmux.conf
set -s set-clipboard on
$ shcopy -v
shcopy version v0.1.3 (3e1e573)
@zachcheung
Copy link
Contributor Author

# not in tmux
$ echo $TERM
xterm-256color
# in tmux
$ echo $TERM
screen-256color
# screen in tmux
$ echo $TERM
screen
$ pbpaste | wc -c
6
$ shcopy 'To use shcopy within a tmux session, make sure that the outer terminal supports OSC 52, and use one of the following options'
$ pbpaste | wc -c
124

OS: macOS 10.15.7

Set the default terminal for new windows created in this session - the default value of the TERM environment variable. For tmux to work correctly, this must be set to ‘screen’, ‘tmux’ or a derivative of them.

https://man.openbsd.org/OpenBSD-current/man1/tmux.1#default-terminal

In tmux, it's quite normal for TERM to be set as screen or a screen derivative. Until macOS 14, macOS supports tmux-256color by default. Therefore, I think solely relying on TERM containing screen to determine the sequence may not be appropriate.

https://gpanders.com/blog/the-definitive-guide-to-using-tmux-256color-on-macos/

zachcheung pushed a commit to zachcheung/shcopy that referenced this issue Jan 18, 2024
zachcheung added a commit to zachcheung/shcopy that referenced this issue Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant