detox icon indicating copy to clipboard operation
detox copied to clipboard

option to ignore spaces and fix only wrong chars

Open stephane-archer opened this issue 10 months ago • 6 comments

This has been requested many times, but I can't find an easy way to do it with detox. Can we introduce an option for this?

https://unix.stackexchange.com/questions/253426/how-to-change-the-default-use-of-detox-so-it-just-doesnt-replace-spaces-by-und

https://github.com/dharple/detox/issues/111

stephane-archer avatar Feb 25 '25 13:02 stephane-archer

I would really like to know how to do this as well. Any help would be appreciated.

hysticali avatar Mar 08 '25 05:03 hysticali

same here

It's really difficult to provide a simple, generic answer for this, because the answer depends on:

  • how you installed detox
  • what version of detox you're using
  • what editor you're comfortable with

The man pages tell you how to do it, but I appreciate that they can be difficult to follow.


If you are familiar with Unix-like configuration files, this is what you need to do, in a nutshell.

If you're using detox 2 or 3, you want to comment out the space entry (0x20) in safe.tbl in /usr/share/detox or /usr/local/share/detox (or wherever it was installed), and then update the default sequence in /etc/detoxrc or /usr/local/etc/detoxrc to use filename "/usr/share/detox/safe.tbl" or filename "/usr/local/share/detox/safe.tbl" instead of builtin "safe".

If you're using detox 1, you need to update the space entry (0x20) in safe.tbl (possibly in one of the locations suggested above). Instead of replacing space with _, you want to replace space with space, and you need to put it in quotes, e.g. " ".

If you're using homebrew, I think the files would be /opt/homebrew/etc/detoxrc and /opt/homebrew/share/detox/safe.tbl`, but that's only a guess.

You can use detox -Lv to get an idea of how detox is configured, and where the config files are.

dharple avatar Aug 10 '25 19:08 dharple

@dharple thank you for your detail answer, is there any hope to see an option to do this without having to modify the default configuration ?

stephane-archer avatar Aug 11 '25 00:08 stephane-archer

@dharple thank you for your detail answer, is there any hope to see an option to do this without having to modify the default configuration ?

At the moment, I can't commit to any enhancements. I don't have the time.

That said, I hear you, and I hear the other people asking for similar changes. I'm thinking about how to make detox easier to use, either with a wrapper layer on top of the base functionality, or with a total rewrite. I'd like to move it toward "it just works," but getting there without completely destroying someone's files is a hard problem to solve.

dharple avatar Aug 11 '25 03:08 dharple

Hi @dharple, thanks for taking the time to respond. I completely understand that you might not have the bandwidth right now to work on new features.

I was a bit surprised to hear that ignoring spaces might require a full rewrite, as from the outside it feels like it could be handled with a small flag or a couple of condition checks. Of course, I haven’t looked into the codebase, so I may be underestimating the complexity here.

That said, perhaps there’s room for a quick, minimal “good enough” solution in the meantime, something lightweight that could help the people asking for it without taking too much of your time or risking bigger changes. Even a temporary, quick and dirty option might make a lot of users happy while keeping the door open for a more complete solution in the future.

stephane-archer avatar Aug 11 '25 06:08 stephane-archer