Skip to content

codinganovel/autocd

Repository files navigation

Directory Inheritance: A Simple Solution for a 50-Year Problem

The Idea

Unix shells have always had this limitation: when you navigate around in vim, ranger, or any other app, you lose that final location when you exit. You're back where you started, not where you ended up.

What if apps could just... inherit their final directory to the shell when they exit?

The Solution

Instead of complex monitoring or protocols, applications can solve this themselves with a simple pattern:

# When your app exits, create a simple transition script:
#!/bin/bash
cd "/final/directory"
exec $SHELL

Then replace your process with that script. Works in any language.

That's it. The user gets a shell in the final directory.

What's Here

Status

I spent time exploring this concept and trying different approaches to make universal directory inheritance work. The shell replacement monitoring approach was too complex and fragile. But this app-level pattern is simple and actually works.

I can't put more resources into this right now, but I wanted to document the idea in case it's useful to others. This isn't a complete solution - just a small contribution to solving a problem that's bugged developers for decades.

If you're building a CLI app that navigates directories, maybe this pattern could help your users. And if enough apps adopt it, maybe we can finally fix this Unix limitation.


Sometimes the best solutions are the simplest ones.

About

Directory Inheritance: A Simple Solution for a 50-Year Problem

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.md
Unknown
LICENSE-COMMERCIAL.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published