You are not logged in.

#976 2011-05-07 20:32:56

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: Ranger, a textbased filemanager

Another little patch: http://paste.pocoo.org/show/387029
Adds an option to display files tags in all columns / only in main column.

Patch edited: ellipsis (for long file names) were not displayed correctly.

Last edited by PotatoesMaster (2011-05-11 18:15:03)

Offline

#977 2011-05-08 14:56:16

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

Thanks potato for all the patches.

PotatoesMaster wrote:

To use zsh alias, functions and stuff with the shell command, edit ranger/defaults/commands.py and replace the line #163 (in shell.execute())

self.fm.execute_command(command, flags=flags)

with

self.fm.execute_command("zsh -ic '" + command + "'", flags=flags)

The command is not properly escaped, which results in incorrect behaviour if there's an apostrophe in the command.
Here are some ways to do it right, pick your favourite:

self.fm.execute_command("zsh -ic '" + command.replace("'", "'\\''") + "'", flags=flags)
from ranger.ext.shell_escape import shell_quote
self.fm.execute_command("zsh -ic " + shell_quote(command), flags=flags)
self.fm.execute_command(["zsh", "-ic", command], flags=flags)

"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#978 2011-05-09 14:51:47

johnnyponny
Member
Registered: 2011-04-23
Posts: 33

Re: Ranger, a textbased filemanager

Greatest file manager I've ever used! Just one question is it possible to make searches instant? Just as ":set incsearch" does in vim?

Offline

#979 2011-05-09 17:36:33

loop
Member
Registered: 2011-05-06
Posts: 58

Re: Ranger, a textbased filemanager

johnnyponny wrote:

Greatest file manager I've ever used! Just one question is it possible to make searches instant? Just as ":set incsearch" does in vim?

Point 3.4  of builtin doc will help you smile Just press 34?

Last edited by loop (2011-05-09 17:44:16)

Offline

#980 2011-05-09 17:43:52

johnnyponny
Member
Registered: 2011-04-23
Posts: 33

Re: Ranger, a textbased filemanager

Oh, how dumb of me, thanks!

Offline

#981 2011-05-09 18:51:48

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

I would like to have some filter options. For example, when you're typing a name, remove all the entries that do not match. Or filter on mimetype, removing all the entries that do not match from the view.

Offline

#982 2011-05-10 18:23:44

skjald
Member
Registered: 2011-04-26
Posts: 9

Re: Ranger, a textbased filemanager

Ranger has become one of my favorite friends. It's the delicious kind of software that you grow personally attached to. I love it. Thanks!

Offline

#983 2011-05-10 21:40:29

mklappstuhl
Member
Registered: 2010-11-14
Posts: 5

Re: Ranger, a textbased filemanager

When I was using a graphical file manager I usually navigated by typing a part of the file/directory and hitting enter.

I know can do this also in Ranger but I need to hit "/" first and then press enter twice.

Is there a way to make this work as before? I really liked that way of navigating wink

Thanks for your work on that pretty beatiful program. (Seriously, it even looks good.)

Offline

#984 2011-05-11 18:07:09

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: Ranger, a textbased filemanager

Revelation60 wrote:

I would like to have some filter options. For example, when you're typing a name, remove all the entries that do not match.

It is possible to filter files matching a string with the command :filter.

Offline

#985 2011-05-11 18:34:43

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: Ranger, a textbased filemanager

If I understand correctly, mklappstuhl says about "live" filter  - something like :find, but with filtering effect and without executing found item as it takes place with :find.

I also have thougth about another (rather current official) filtering way - more "quick and live". The thing is, we need equally "quck and live" way to reset a filter.

BTW, what is a current official way to reset :filter? I use :filter without context, but probably there is more short way, isn't it?


"I exist" is the best myth I know..

Offline

#986 2011-05-11 20:02:38

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

Using the filter option, I made this:

class inc_filter(Command)
    def quick(self):
        import re
        line = parse(self.line)
        self.fm.set_filter(line.rest(1))
        self.fm.reload_cwd()

This will update the filter on the fly. Maybe this is not the best method. Also, I think the filter should be removed when going to a new directory/opening a file. Don't know how to do that though.

Offline

#987 2011-05-12 03:32:31

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

Sorry to harp on you-- but have you tracked down the memory leak? I have tested on a few kernels and I seem to still get it on different setups. I am curious if this is somehow on my end or on Ranger's but I know Ranger is right in the middle of it.

Offline

#988 2011-05-14 21:22:57

johnnyponny
Member
Registered: 2011-04-23
Posts: 33

Re: Ranger, a textbased filemanager

Is it possible to ''open folder'' with ranger, in chromium?
Tried installing libfile-mimeinfo-perl as of this guide http://crunchbanglinux.org/forums/topic … tegration/
and

xdg-mime default ranger.desktop application/x-directory

it worked with thunar but not with ranger. Does it have something with ranger being in a terminal?

Offline

#989 2011-05-15 15:18:46

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: Ranger, a textbased filemanager

@johnnyponny:
Does the file "ranger.desktop" exist ?

It's necessary to open a terminal to run ranger.
You can do that with a single command (depending on your terminal emulator).

xterm -e ranger /path/to/directory
urxvt -e ranger /path/to/directory
gnome-terminal -e "ranger /path/to/directory"

@Revelation60, @student975:
Live filter/find is a great idea !

Here is my try to implement it (based on code from find command):
http://paste.pocoo.org/show/391962

Some disappointments:
- I don't know how disable filter when command mode is exited with escape key or ^c
- always case sensitive (because of filter command)

Last edited by PotatoesMaster (2011-05-19 18:37:24)

Offline

#990 2011-05-19 14:45:10

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

Google wrote:

My Ranger seems to have a memory leak, or something. I have only narrowed it down to Ranger. It seems when I leave Ranger open it slowly builds up memory usage within Urxvt. At the start Urxvt uses about .4% memory. After leaving Ranger open for a while the usage creeps up. I have had it use over 10% of 4gb memory! After closing ranger the usage drops back down to .4% for Urxvt.

Any reason for this?

To be honest, I dont really know where to look since it doesnt happen to me and I'm not familiar with urxvt code :( The only time urxvt consumes more memory is when I view international characters, its probably caching them. But that doesn't seem to be connected to your case since the memory usage doesn't change when ranger closes.

Maybe it helps if you use urxvt client + server? Is anyone else experiencing Google's problem?

student975 wrote:

BTW, what is a current official way to reset :filter? I use :filter without context, but probably there is more short way, isn't it?

Yeah, zf<enter> is the "official" way. You can always bind a custom key. To clear all filters, press ^R.

PotatoesMaster wrote:

I noticed that when <A-something> is mapped in console mode, pressing Escape doesn't quit this mode.

Hm I thought I explicitly handled that case... Turns out that ALT+key is translated to <ESC>+key, which overrides previous <ESC> bindings. I uploaded a fix to ranger-git.

PotatoesMaster wrote:

Some disappointments:
- I don't know how disable filter when command mode is exited with escape key or ^c
- always case sensitive (because of filter command)

I'll implement a cancel() method for commands that is called when you close the console.
As for the case sensitive part, try this:

def custom_accept_file(fname, dirname, hidden_filter, name_filter):
    if hidden_filter:
        try:
            if hidden_filter.search(fname):
                return False
        except:
            if hidden_filter in fname:
                return False
    if name_filter and name_filter.lower() not in fname.lower():
        return False
    return True

import ranger.fsobject.directory
ranger.fsobject.directory.accept_file = custom_accept_file

I am overriding the accept_file function in ranger/fsobject/directory.py here. The bold parts were added. This function determines whether or not a file should be displayed. Put this in any config file, preferably in options.py. Maybe there should be an easier way to allow case insensitive filtering but this one is way more flexible IMO. You can do awesome things like:

def custom_accept_file(fname, dirname, hidden_filter, name_filter):
    if dirname == os.environ['HOME'] and fname == 'XXX': return False  # PRIVATE !!!
    ....


@everyone:
Sorry dudes that I'm less active than before, but it's getting difficult for me to allocate brain-time for ranger. I only have so many hours per day and there is so much to do.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#991 2011-05-19 15:15:03

igndenok
Member
From: Sidoarjo, Indonesia
Registered: 2010-06-07
Posts: 160

Re: Ranger, a textbased filemanager

We really appreciate for your contribution hut for this awesome file manager smile
Now we need everyone that use ranger for share their useful command or post it in wiki, so we all can get benefit from it, and the important part is let the world how awesome this file manager big_smile


Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.

Offline

#992 2011-05-19 16:24:51

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

litemotiv wrote:

I'm having a bit of a strange problem lately. I'm using autofs to mount a couple of remote servers with sshfs (/media/ssh/servername) and while a normal ls or cd into their directories works fine, using ranger often causes a timeout/hang that lasts 20-30 seconds to several minutes. During this time all sshfs traffic is stalled, so other open connections also stop working. Once the freeze is over, all traffic is and stays back normal. This only happens on the first 'connect' to a directory managed by autofs.

Any idea where to start debugging this..?

http://lists.nongnu.org/archive/html/ra … 00000.html
summary: comment out the line with the [...]get_free_space[...] part in ranger/gui/widgets/statusbar.py and see if it helps with network file system issues.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#993 2011-05-19 17:36:46

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Ranger, a textbased filemanager

hut wrote:

http://lists.nongnu.org/archive/html/ra … 00000.html
summary: comment out the line with the [...]get_free_space[...] part in ranger/gui/widgets/statusbar.py and see if it helps with network file system issues.

I switched to systemd which automounts as well, so i'm not using autofs anymore. Ranger runs just fine now, but thanks for remembering me! smile


ᶘ ᵒᴥᵒᶅ

Offline

#994 2011-05-19 19:00:25

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: Ranger, a textbased filemanager

@hut:
Thanks !
I didn't know it was possible to override functions this way. smile
I edited the live_filter function up there to restore case insentitive matches.

Last edited by PotatoesMaster (2011-05-19 19:10:04)

Offline

#995 2011-05-20 16:28:31

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

hut wrote:
PotatoesMaster wrote:

Some disappointments:
- I don't know how disable filter when command mode is exited with escape key or ^c
- always case sensitive (because of filter command)

I'll implement a cancel() method for commands that is called when you close the console.

Done, just add a cancel() method to your command. works like execute() but is called when you press <ESC> rather than <ENTER>


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#996 2011-05-22 18:19:12

johnnyponny
Member
Registered: 2011-04-23
Posts: 33

Re: Ranger, a textbased filemanager

Is there a script to make you cd to that directory that you were in last when you quit ranger? I think I have seen something like that but I can't find it.

Edit: Nevermind I read it on the git page big_smile

Last edited by johnnyponny (2011-05-22 18:22:03)

Offline

#997 2011-06-29 05:51:02

cleanrock
Member
Registered: 2008-11-17
Posts: 109

Re: Ranger, a textbased filemanager

Always when i start a program in background i get a zombie process when that process ends, e.g. playing a video in mplayer.
Do other people see this ?
If not, did u so some special config in ranger do avoid this ?
I see this in both the stable version and the git version.

Offline

#998 2011-06-29 11:36:06

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: Ranger, a textbased filemanager

I think that's normal, since all zombies (dead children) are left until their parent dies. When you end Ranger, all zombies will go away with it. I think zombies don't use any resources.

Offline

#999 2011-06-29 14:56:07

cleanrock
Member
Registered: 2008-11-17
Posts: 109

Re: Ranger, a textbased filemanager

Yes, zombies dont consume any resources (except for pid maybe) but it is ugly and should be avoided.
I think it should be quit easy to do a "waitpid" for background tasks in ranger.

Offline

#1000 2011-07-02 10:05:41

cap_sensitive
Member
Registered: 2010-04-05
Posts: 35

Re: Ranger, a textbased filemanager

Hi, hut:
I put the following lines to apps.py:

    def app_sxiv(self, c):
        return tup('sxiv', '-F', *c)

And encountered an error:

  File "/home/syp/.config/ranger/apps.py", line 99
    def app_sxiv(self, c):
                         ^
IndentationError: unindent does not match any outer indentation level

[edit]
My fault. I should use real TAB instead of SPACE. Sorry.

Last edited by cap_sensitive (2011-07-02 10:07:13)

Offline

Board footer

Powered by FluxBB