Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@l4zygreed
Copy link

@l4zygreed l4zygreed commented Apr 27, 2025

Updated Ethan PR for current master

ISSUE TYPE

  • Improvement/feature implementation

RUNTIME ENVIRONMENT

  • Operating system and version: Macos sequoia 15.4
  • Terminal emulator and version: Ghostty 1.1.3
  • Python version: 3.13.3
  • Ranger version/commit: ranger-master v1.9.3-794-gcf51b12f
  • Locale: en_US.UTF-8

CHECKLIST

  • The CONTRIBUTING document has been read [REQUIRED]
  • All changes follow the code style [REQUIRED]
  • All new and existing tests pass [REQUIRED]
  • Changes require config files to be updated
    • Config files have been updated

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 test executed successfully
  • kitty without tmux
  • kitty with tmux and allow-passthrough not set
  • kitty with tmux and allow-passthrough set
  • ghostty without tmux
  • ghostty with tmux and allow-passthrough not set
  • ghostty with tmux and allow-passthrough set

IMAGES / VIDEOS

cleanshot.mp4

Copy link

@Ethsan Ethsan left a 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.

ranger/ext/img_display.py Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
@l4zygreed l4zygreed force-pushed the feat/kitty_in_tmux branch from 3608676 to 3ac971f Compare May 18, 2025 04:55
@Ethsan
Copy link

Ethsan commented May 18, 2025

Resolve #2414, Resolve #2846, Resolve #3072

@toonn
Copy link
Member

toonn commented May 19, 2025

Do the resolve comments work in comments or should they be part of commit messages?
(Since this seems to work for both of you I think it's had enough testing. Feel free to pester me once a week until I review and merge.)

@Ethsan Ethsan mentioned this pull request May 19, 2025
5 tasks
@Ethsan
Copy link

Ethsan commented May 19, 2025

Hi,

Do the resolve comments work in comments or should they be part of commit messages?

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.

(Since this seems to work for both of you I think it's had enough testing. Feel free to pester me once a week until I review and merge.)

Ok, the PR seems good for me.

@Ethsan Ethsan force-pushed the feat/kitty_in_tmux branch 2 times, most recently from 153c40b to 62c8d89 Compare May 22, 2025 23:00
@Ethsan
Copy link

Ethsan commented May 22, 2025

Hi,
@toonn do you prefer something like that ? or should we revert ?

ranger/ext/img_display.py Outdated Show resolved Hide resolved
Copy link
Member

@toonn toonn left a 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.

ranger/data/rowcolumn-diacritics.txt Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
@l4zygreed l4zygreed force-pushed the feat/kitty_in_tmux branch from 519e4f1 to c9c4776 Compare July 4, 2025 17:19
@l4zygreed
Copy link
Author

Sorry, been busy. (War and busy work - great combination, lol 🤣)
Thought Ethsan would add the fixes. But I can work on PR a little bit now.

@Ethsan
Copy link

Ethsan commented Jul 4, 2025

I wanted too but I was busy and then completely forgot the PR. Sorry about that

ranger/ext/img_display.py Show resolved Hide resolved
@l4zygreed l4zygreed force-pushed the feat/kitty_in_tmux branch from c9c4776 to fa64967 Compare July 13, 2025 20:52
ranger/ext/img_display.py Outdated Show resolved Hide resolved
@l4zygreed l4zygreed requested a review from toonn August 15, 2025 10:29
@l4zygreed
Copy link
Author

@toonn Hello, can you review new commits? 🙃

@l4zygreed
Copy link
Author

@toonn 👋🏻😪

@l4zygreed
Copy link
Author

@toonn Notice me, senpai 😢

@l4zygreed
Copy link
Author

@toonn
a-cartoon-of-a-woman-sitting-on-a-bed-with-the-words-mum-mum-mum-below-her

@l4zygreed
Copy link
Author

@toonn

@l4zygreed
Copy link
Author

@toonn check the commits, senpai

Copy link
Member

@toonn toonn left a 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.

ranger/ext/img_display.py Outdated Show resolved Hide resolved
self.tmux_protocol_start,
self.protocol_start,
msg,
self.tmux_protocol_end,
Copy link
Member

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.

Copy link
Author

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.

# Wrap bite string into protocol.
# With tmux passthrough if inside tmux.
if self.is_tmux:
return b'%s%s%s%s%s' % (
Copy link
Member

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.

Copy link
Author

@l4zygreed l4zygreed Nov 2, 2025

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 then encode into bytes. (Or remove all encodes before that.)
  • do something like b''.join(protocal_start, msg, protocol_end)

ranger/ext/img_display.py Outdated Show resolved Hide resolved
ranger/ext/img_display.py Outdated Show resolved Hide resolved
@l4zygreed l4zygreed force-pushed the feat/kitty_in_tmux branch 6 times, most recently from 5aa71e9 to cf07846 Compare November 9, 2025 22:49
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

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.