-
Notifications
You must be signed in to change notification settings - Fork 917
use tmux passthrough for kitty graphics protocol #3086
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for the keeping the pr alive and the update, it's cleaner now!
Should we separate the commit in two ? Something like :
- support for virtual placement using unicode placeholder
- support for tmux allow-passthrough mode
Moreover some minor changes below.
3608676 to
3ac971f
Compare
|
Do the resolve comments work in comments or should they be part of commit messages? |
|
Hi,
From what I read, the resolve don't work in comment, so they should be part of the commit message. I have commented them so we don't have to search them later.
Ok, the PR seems good for me. |
153c40b to
62c8d89
Compare
|
Hi, |
toonn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW in the future I'd prefer if people tried to PR to the PR branch of the original PR author, possibly linking to the downstream PR in our PR comments. It's inconvenient to keep track of things if people keep opening new PRs that are really the same thing. Rebasing on master is usually quite trivial so you can rest assured that that is not what holds back a PR from getting merged.
In this case Ethsan seems perfectly happy with the situation but it can come across as trying to take credit for someone else's work. All of this is easily avoided by opening the PR against their PR branch.
519e4f1 to
c9c4776
Compare
|
Sorry, been busy. (War and busy work - great combination, lol 🤣) |
|
I wanted too but I was busy and then completely forgot the PR. Sorry about that |
c9c4776 to
fa64967
Compare
e26c319 to
0e10248
Compare
|
@toonn Hello, can you review new commits? 🙃 |
0e10248 to
59634bc
Compare
|
@toonn 👋🏻😪 |
59634bc to
7076abb
Compare
|
@toonn Notice me, senpai 😢 |
7076abb to
fbce1e0
Compare
e5e0508 to
9f9e4b7
Compare
|
@toonn check the commits, senpai |
toonn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things I wanted to ask, let me know what you think.
| self.tmux_protocol_start, | ||
| self.protocol_start, | ||
| msg, | ||
| self.tmux_protocol_end, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see what you're doing with tmux_protocol_{start,end} but that seems confusing honestly, because of the interleaving.
And couldn't the msg contain \x1b? I think being explicit about doubling the \x1bs would be more straightforward code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messages containing \x1b doesn't use wrap function.
but updated anyway, now should be less confusing.
ranger/ext/img_display.py
Outdated
| # Wrap bite string into protocol. | ||
| # With tmux passthrough if inside tmux. | ||
| if self.is_tmux: | ||
| return b'%s%s%s%s%s' % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use "".format() syntax, % is really old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bytes doesn't have format attribute, so this syntax AFAIK is the only formatting syntax for them.
Workarounds are:
- possible double conversion - convert bytes into strings (because otherwise they'll be formatted as
b'b"msg"'), format as string and thenencodeinto bytes. (Or remove all encodes before that.) - do something like
b''.join(protocal_start, msg, protocol_end)
5aa71e9 to
cf07846
Compare
Updated Ethan PR for current master Co-authored-by: Ethan <milonthan@gmail.com>
Updated Ethan PR for current master Co-authored-by: Ethan <milonthan@gmail.com>
In some apps code 027 should be used instead of 033, but x1b is universal value
Wrote protocol wrap, read, and write functions for kitty class. Also replaced string concatenation with formatting to decrease a little amount of operations and memory allocations.
cf07846 to
4d948cb
Compare

Updated Ethan PR for current master
ISSUE TYPE
RUNTIME ENVIRONMENT
CHECKLIST
CONTRIBUTINGdocument has been read [REQUIRED]DESCRIPTION
Updated PR #2856 to be compatible with current master branch.
MOTIVATION AND CONTEXT
Want to finally see images inside tmux on my mac and outside of iterm/kitty terminal 😆
Found old Ethan PR and decided to resolve conflicts and update it for current master
TESTING
make testexecuted successfullyIMAGES / VIDEOS
cleanshot.mp4