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

wezterm imgcat with vifm #2902

Open
Grueslayer opened this issue Dec 29, 2022 · 2 comments
Open

wezterm imgcat with vifm #2902

Grueslayer opened this issue Dec 29, 2022 · 2 comments
Labels
bug Something isn't working Windows Issue applies to Microsoft Windows

Comments

@Grueslayer
Copy link

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20221122-154621-68c754b1

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

wezterm and vifm using imgcat don't work quite well together, some behaviour maybe is Windows specific other maybe a global issue.

adding this to vifmrc will add a preview (when using :view in vifm) for picture files

  fileviewer {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*>
         \ wezterm imgcat --width %pw --height %ph %c:p %pd

for windows maybe using escaped filepath is better

  fileviewer {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*>
         \ wezterm imgcat --width %pw --height %ph %"c:p %pd

On MacOS it will correctly displays the image but the file list pane will get corrupted.
Maybe that can be fixed by not changing the cursor?

So we need to add an option to wezterm imgcat. By the way, it would be nice to have the upper left position X/Y also as new parameters like imgcat support.

On Windows it looks quite different: No image (or any other thing) is been displayed, the area keeps empty.
Calling wezterm imgcat with the same parameters diplays it the right way.

So I can only assume

a) it is been displayed outside the area (because vifm has a different cursor position on windows, so having x/y as parameter like described above may help)
b) vifm has a different / alternative screen area than wezterm uses

Would be fine to fix both things (maybe we need the help from vifm maintainer).

I can help to setup vifm for testing purposes on your system.

To Reproduce

No response

Configuration

no config

Expected Behavior

No response

Logs

No response

Anything else?

No response

@Grueslayer Grueslayer added the bug Something isn't working label Dec 29, 2022
@wez
Copy link
Owner

wez commented Dec 29, 2022

There's not a lot for me to go on here. Can you reduce things to concrete steps and concrete descriptions?

I can't install and replicate every possible environment as I simply don't have the time or resources to do that; I'm not going to learn what vifm is or install it on multiple operating systems.

It can sometimes be helpful to include a session recording for a specific scenario; here's my canned response for that:


  • Launch wezterm. If possible, please use the default terminal size of 80x24 cells as it helps to keep things smaller and easier to manage.
  • Inside that terminal run wezterm record to start a recording session.
  • Run through your reproduction steps
  • Then type exit
  • You should see a message like:
*** Finished recording to /var/tmp/wezterm-recording-sF6B3u.cast.txt
  • Attach the file that it produced to this issue.

The file is an asciicast (compatible with https://asciinema.org/) and can also be replayed using wezterm replay.

The terminal recording allows me to replicate what is being sent to the terminal without requiring me to install the same applications as you and replicate your configuration for everything.


Regarding Windows: ConPTY can swallow or re-order escape sequences that it doesn't understand in a number of situations.
Relevant upstream issues are:

A way to determine if an issue is ConPTY specific is to use wezterm ssh to connect to a unix system (either linux or macos) and run the same software: if that works fine then the issue is most likely due to ConPTY.

@wez wez added the waiting-on-op Waiting for more information from the original poster label Dec 29, 2022
@Grueslayer
Copy link
Author

I tried to strip it down and create a simple example as possible (but I think you should have a look at vifm as it is the best file manager imho)

The following lines will

  1. create a new directory
  2. loading two of your images as new files into this directory
  3. downloading vifm.exe (it is a simple exe without any further files or installation needed)
  4. starting local vifm, skipping any configuration file, setting the second pane as preview and selecting two.png (which should than be displayed in the right pane but isn't)
mkdir weztermvifmtest
cd weztermvifmtest

curl https://wezfurlong.org/images/wez-flame-hair.jpg -o wez-flame-hair.jpg
curl https://wezfurlong.org/wezterm/screenshots/two.png -o two.png

curl https://builds.vifm.info/builds/vifm-w64-se-v0.12.1-120-g919cdec6aebf.exe -o vifm.exe

.\vifm.exe --no-configs -c view --select two.png -c "fileviewer {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*> wezterm imgcat --width %pw --height %ph %\"c:p %pd"

Furthermore I made a record session which these files and moving the cursor two files down to have the second image selected, which is also not been displayed.

wezterm-recording-dPTLvp.cast.txt

@github-actions github-actions bot removed the waiting-on-op Waiting for more information from the original poster label Dec 30, 2022
@wez wez added the Windows Issue applies to Microsoft Windows label Apr 9, 2023
wez added a commit that referenced this issue May 21, 2023
I want to try out the FTCS flush and any other conpty fixes that may
have been made since our last update.

refs: microsoft/terminal#13710

These other issues may experience improved results, but likely not:

refs: #3748
refs: #3624
refs: #2779
refs: #2902
refs: #3531
refs: #3562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows Issue applies to Microsoft Windows
Projects
None yet
Development

No branches or pull requests

2 participants