Git Product home page Git Product logo

Comments (21)

linsui avatar linsui commented on August 16, 2024 2

Yes, that makes sense. It would be better to use xdg-open on linux by default.

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024 2

Hi @linsui, @ManuLinares, @SolitudeSF

A new for option added, which allows dividing opener rules by system type. Yazi now uses xdg-open on Linux, open on macOS by default. #289
image

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

When it's stuck at 99%, it usually means there's an error during task execution. You can press w to view the task list and then press x to terminate the selected task forcefully.

Considering that you're trying to open a directory, it's possible that your system doesn't have the open command. You can change open to xdg-open or any other command in your yazi.toml file. This is one of the few configurations in Yazi that users may need to modify themselves.

from yazi.

linsui avatar linsui commented on August 16, 2024

Is that possible to replace all open with xdg-open?

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

It depends on your desktop environment, yes, if your system has the xdg-open command.

You can copy yazi.toml as ~/.config/yazi/yazi.toml to use your own configuration file.

from yazi.

linsui avatar linsui commented on August 16, 2024

Thanks!

from yazi.

dreamerlzl avatar dreamerlzl commented on August 16, 2024

So this works on my side:

image = [
        { exec = 'xdg-open "$@"', display_name = "Open" },
        { exec = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show EXIF" },
]

IMO mentioning the configuration for open in readme.md would be helpful.

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

@dreamerlzl Thank you for sharing it here, I have created a new document and already included this issue in the faq

https://yazi-rs.github.io/docs/usage/faq#why-i-cant-open-file--stuck-at-99

from yazi.

linsui avatar linsui commented on August 16, 2024

Can yazi show the error message instead of stucking on 99%?

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

You can press <Enter> on a task to inspect the error message

https://yazi-rs.github.io/docs/usage/configuration/keymap#:~:text=down%201%20line.-,inspect,-%3A%20Inspect%20the%20task

from yazi.

ManuLinares avatar ManuLinares commented on August 16, 2024

I'll ask here then:

  1. What is this "open" command and What distro ships with this command?
  2. What Desktop Environment assumes this command exists?
  3. Why wasn't this on the "requirements" at the home page?

Is this a design flaw? If it is, here are my main concerns:

  1. The "requirement" of open should be explicitly on the home page.
  2. When this error happens, it should be showed to the user with a flash or an error message. (nothing happening is bad design).
  3. In the FAQ I see you've added a link, but you could also add the text. "Yazi needs 'open' command to work." so prevents hoping excessively.

from yazi.

SolitudeSF avatar SolitudeSF commented on August 16, 2024

im pretty sure open is macos command. yazi configuration preset defaults to mac.

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

What is this "open" command and What distro ships with this command?
What Desktop Environment assumes this command exists?
Why wasn't this on the "requirements" at the home page?

open is a built-in command in Yazi, used for matching and triggering a specific opener rule. In this context, there is an opener that invokes the system open -- yes, their names happen to be the same, but they are entirely different things. If you are referring to this opener:

Yep, open is a command on macOS, Linux typically uses xdg-open (or something else?), and Windows doesn't need open as it directly runs the file to open (even if it's not a .exe). I'm aware that Fish shell aliases "xdg-open" as "open", but I'm not sure if other OS/DEs exhibit similar behavior; this requires further investigation.

Currently, I haven't found a good way to unify them, so it needs to be manually changed by the user, and the default opener rules are just an example. I look forward to improving this further and welcome any constructive suggestions.

When this error happens, it should be showed to the user with a flash or an error message. (nothing happening is bad design).

What I need to clarify here is that it's not "nothing happening".

Each opener is scheduled as an independent process by the task system. When a task fails (such as "open"), showing a 99% progress bar at the bottom is the current expected behavior. To my knowledge, other terminal file managers like Ranger exhibit the same behavior when tasks fail.

At this point, the user needs to press w to see which task has failed and press <Enter> to view the specific stdout and stderr. I'm not sure how to use a "flash" to notify the user and print stdout and stderr to the screen when a task fails. What if they are lengthy or contain other escape codes? Or should we just prompt the user to press w? I think ultimately, the user will have to enter the task manager to check and terminate the failed task, so is this necessary? And when multiple tasks fail, would frequent "flashing" disrupt the user?

The better approach I currently have in mind is to change the progress bar color to red, when a task encounters an error and then keep it at 99%. I believe this should be enough to alert the user that a task has failed, and it's part of the theme system I'm currently working on.

The "requirement" of open should be explicitly on the home page.
In the FAQ I see you've added a link, but you could also add the text. "Yazi needs 'open' command to work." so prevents hoping excessively.

There are many areas in Yazi that need improvement, and this will take time. Right now, I'm dedicating my limited time to improving documentation and the theme system. I've created new documentation for Yazi, and if you have any ideas, feel free to click a "Edit this page" to improve it :)

from yazi.

linsui avatar linsui commented on August 16, 2024

At this point, the user needs to press w to see which task has failed and press to view the specific stdout and stderr. I'm not sure how to use a "flash" to notify the user and print stdout and stderr to the screen when a task fails. What if they are lengthy or contain other escape codes? Or should we just prompt the user to press w? I think ultimately, the user will have to enter the task manager to check and terminate the failed task, so is this necessary? And when multiple tasks fail, would frequent "flashing" disrupt the user?

I thought it would make sense to display "1 task failed" instead of "99% 1 left".

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

I thought it would make sense to display "1 task failed" instead of "99% 1 left".

This would result in 10 tasks where even if 1 fails, the progress of the other 9 tasks remains unknown.

from yazi.

linsui avatar linsui commented on August 16, 2024

How about 100% 1 failed?

from yazi.

ManuLinares avatar ManuLinares commented on August 16, 2024

What is this "open" command and What distro ships with this command?

open is a built-in command in Yazi, used for matching and triggering a specific opener rule. In this context, there is an opener that invokes the system open -- yes, their names happen to be the same, but they are entirely different things. If you are referring to this opener:

Yep, open is a command on macOS, Linux typically uses xdg-open (or something else?), and Windows doesn't need open as it directly runs the file to open (even if it's not a .exe). I'm aware that Fish shell aliases "xdg-open" as "open", but I'm not sure if other OS/DEs exhibit similar behavior; this requires further investigation.

Currently, I haven't found a good way to unify them, so it needs to be manually changed by the user, and the default opener rules are just an example. I look forward to improving this further and welcome any constructive suggestions.

xdg-open comes with the package xdg-utils which is bundled in virtually every distribution, so in Linux is mostly standard to use it.

There are many areas in Yazi that need improvement, and this will take time. Right now, I'm dedicating my limited time to improving documentation and the theme system. I've created new documentation for Yazi, and if you have any ideas, feel free to click a "Edit this page" to improve it :)

Thanks ❤️

from yazi.

linsui avatar linsui commented on August 16, 2024

xdg-open comes with the package xdg-utils which is bundled in virtually every distribution, so in Linux is mostly standard to use it.

I tested on a headless Debian, open is installed (linked to /usr/bin/run-mailcap) but xdg-open is not.

from yazi.

ManuLinares avatar ManuLinares commented on August 16, 2024

xdg-open comes with the package xdg-utils which is bundled in virtually every distribution, so in Linux is mostly standard to use it.

I tested on a headless Debian, open is installed (linked to /usr/bin/run-mailcap) but xdg-open is not.

What would you expect to happen when using open in a "headless" session?
Screenshot_2023-09-21_14-11-32

There are obviously edge cases, I'd just put xdg-utils as a requirement

from yazi.

sxyazi avatar sxyazi commented on August 16, 2024

Hey @ManuLinares, the new theme system has been completed, and now the progress bar's color will turn red when an error occurs. You can build and experience it from the main branch :)

from yazi.

github-actions avatar github-actions commented on August 16, 2024

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

from yazi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.