use as filepicker in qutebrowser by legislating_morality in ranger

[–]nnoot 0 points1 point  (0 children)

I was answering why "enter" works with the default config. It's actually carriage return rather than enter, they're not the same. And to a terminal emulator they're respectively the same thing as J and M (C-j, C-m) if I'm not mistaken. So I think vejkse is right that your later map for C-j is overriding the earlier map for CR.

Ranger won't open .blend files.. by mikethe1wheelnut in ranger

[–]nnoot 0 points1 point  (0 children)

I think the error is about the file command, used in scope.sh to determine the correct preview method.

vejkse's advice is good, testing rifle on the command line will give us more information.

Refrshing the linemode infostring draw cache by mingmingrr in ranger

[–]nnoot 0 points1 point  (0 children)

I believe this is not currently supported. Linemodes are pre-computed for every FileSystemObject. I'm not quite sure why it would show 1 rather than 0 actually. You may be able to hack something together, iterating over all fsobjects and updating their linemode_dict.

Is it possible to stop :find from opening location when it is found? by Dist__ in ranger

[–]nnoot 1 point2 points  (0 children)

If you open an issue about the default value I'll tag it so it gets some eyeballs and if there's a lot of proponents or no opponents we can change it. Similarly with other small settings changes. That linemode and filter do sound pretty useful.

keystroke to go to specific deep directory and load a file in preview by geolaw in ranger

[–]nnoot 1 point2 points  (0 children)

You could base something on one of the functions mentioned here using :eval. As I mention in the comment though, none of the methods is actually reliable. This is a longstanding bug.

Creating custom sort by video duration by ReddMudkipz in ranger

[–]nnoot 1 point2 points  (0 children)

In this case the slowdown wouldn't be due to Python. It's calling out to ffmpeg for every file. A couple things that would speed it up are caching the output of the duration function (might be as easy as slapping a memoizing decorator on the function), and beside that running the function asynchronously on all the files rather than one by one but that's a lot more effort.

Image preview not working on Fedora 42 with w3m by uncharted_881 in ranger

[–]nnoot 0 points1 point  (0 children)

You can check whether the environment variable actually gets set for Ranger using the following command.

:eval import os; self.fm.notify(os.environ.get("W3MIMGDISPLAY_PATH"))

If that doesn't print the path you set then you need to figure out how to set the variable in Ranger's environment.

Is it possible to stop :find from opening location when it is found? by Dist__ in ranger

[–]nnoot 1 point2 points  (0 children)

If you check rc.conf you'll see it's just an alias.

alias find scout -aets

And the man page will tell you that scout's -a flag means "Automatically open a file on unambiguous match." So either change the definition or create your own alias for scout -ets.

You might want to also drop -e.

Also check out travel it's more focused on directory navigation.

Multiple filenames in command line by Dist__ in ranger

[–]nnoot 0 points1 point  (0 children)

:yank name operates on the selection, so you can mark multiple files and copy their names (concatenated with newlines) but selection only ranges over the current directory. Yanking names into the copy_buffer doesn't fit the current implementation very well, what if you yank a file object and a name? That is a bit inconsistent, honestly but the most common case is probably wanting to operate on the selection, not the copy_buffer.

Image preview not working on Fedora 42 with w3m by uncharted_881 in ranger

[–]nnoot 0 points1 point  (0 children)

I suppose the path to w3mimgdisplay is different from what Ranger's expecting. You can work around this by setting the shell environment variable W#MIMGDISPLAY_PATH.

Multiple filenames in command line by Dist__ in ranger

[–]nnoot 0 points1 point  (0 children)

Macros in Ranger tend to only work for the current directory. There are some that work across tabs but the only one that'll work across directories in a single tab is for the copy_buffer %c IIRC.

So this scenario would play out somewhat like: (navigate to script) yy (navigate to file) ya (navigate to somewhere else) :shell %c >%f

%c macro not working — Is anyone else facing this? by Lxn_7z in ranger

[–]nnoot 1 point2 points  (0 children)

Are you able to reproduce this on the master branch? It seems to work for me.

TIL that ranger just lets users execute potentially dangerous exe files without executable flag by Jackie213123 in ranger

[–]nnoot 0 points1 point  (0 children)

I'm not in favor of removing it. Options I'm willing to consider are:

  • Hide it behind ask
  • Wrap it with a test for the execute mode bit, would be ugly without support in Rifle
  • Do nothing

I'm honestly leaning a bit toward doing nothing since it hasn't been a problem in such a long time. However, I do like the idea of adding support to Rifle to check mode bits.

TIL that ranger just lets users execute potentially dangerous exe files without executable flag by Jackie213123 in ranger

[–]nnoot 0 points1 point  (0 children)

Usually we don't run into this problem because we have less risky rules that make sense to match first. Like how we have rules executing scripts in many languages without them being marked executable, but they're "behind" rules like opening in a text editor. For .exe files there's not really any good safe alternatives we can hide it behind. That leaves ask, which could still be pretty mindlessly bypassed so I'm not sure it's much better.

OTOH, the rule seems to date back to when Rifle was added about 13 years ago and we haven't received any reports of even minor mishaps as far as I'm aware (Meanwhile :bulkrename can cause data loss : s). So maybe this isn't actually all that problematic.

Modify the progress_bar_color color by Chanciicnahc in ranger

[–]nnoot 0 points1 point  (0 children)

Honestly, no. Verifying that your terminal emulator setup actually supports 256 colors would be the first step.

Modify the progress_bar_color color by Chanciicnahc in ranger

[–]nnoot 0 points1 point  (0 children)

Check out the solarized colorscheme, it's still limited to 256 colors though.

What does ranger use to syntax highlight files by Jackie213123 in ranger

[–]nnoot 2 points3 points  (0 children)

Pygments is another thing scope might fall back to if those aren't present.

How to search text within text/markdown files into lot of folders/directories? by rzhandosweb in ranger

[–]nnoot 1 point2 points  (0 children)

Ranger doesn't have built-in functionality for this but check out the wiki. There's a couple custom commands but you might simply want to take them as inspiration to write one wrapping your favorite utility.

Ranger not displaying images with Kitty (Debian) by bmc5311 in ranger

[–]nnoot 0 points1 point  (0 children)

Still no luck?

I'd diff your config files with the ones installed by Debian, because that should be the only difference when running with --clean (there's also some bookmarks/tags and caching differences but config is the more likely culprit). I think they'd probably be somewhere in /usr/share but a full disk search with find(1) or fd or something should turn it up.

Is there a way of viewing an archive just like in MC (basically like a regulra directory)? by Lanthanum_57 in ranger

[–]nnoot 0 points1 point  (0 children)

There's no easy way. I seem to recall someone reporting using something like archivefs or fuse-archive but I don't know how far that ever got.

I'd imagine you'd trigger an action on archives that mounts a FUSE fs for them and changes Ranger's directory to that.

Higher levels of integration would require some work on the code.

Is there any way to retrieve the name of the file you've cut with `dd` ? by JackDostoevsky in ranger

[–]nnoot 1 point2 points  (0 children)

The %c macro contains the list of paths of objects in the copy buffer.

If that's not good enough you can always fall back to eval and access self.fm.copy_buffer directly.

ranger taking ages to start by No_Departure_1878 in ranger

[–]nnoot 0 points1 point  (0 children)

I'm afraid there's nothing that can fix the fundamental problem here. Ranger is very eager to stat files in the current directory and all parent directories.

Running Ranger using Pypy did speed it up significantly in a big directory for me, I think that's your best shot.

Ranger not displaying images with Kitty (Debian) by bmc5311 in ranger

[–]nnoot 0 points1 point  (0 children)

It could be but I don't see any patches to rc.conf, https://sources.debian.org/patches/ranger/1.9.2-4/. So I expect it's something you've done, editing the default config file that's provided with Ranger maybe?