Git Product home page Git Product logo

Comments (10)

kamiyaa avatar kamiyaa commented on July 27, 2024

Will probably need to write some sort of hack for this (combination of shell script and rust). I will see what I can do

from joshuto.

PolyMeilex avatar PolyMeilex commented on July 27, 2024

As far as I know, this would require some really hanky code or a shell plugin. It would be probably better to start nested shell instance inside of joshuto like ranger does with it's S shortcut

from joshuto.

ztlevi avatar ztlevi commented on July 27, 2024

It looks like ranger is using some ipc magic.

See the signal lib and signal_emit

from joshuto.

ztlevi avatar ztlevi commented on July 27, 2024

@kamiyaa I found the way to change dir on exit. This is the script I use. Take a look at ranger's --choosedir option. It dumps last visited dir path to that file and then will be used for cd. You can provide similar options.

ranger-cd () {
        tmpfile='/tmp/choosedir'
        curdir=$(pwd)
        ranger --choosedir="$tmpfile" "${@:-$curdir}"
        if [[ -f "$tmpfile" ]] && [[ $(cat "$tmpfile") != $curdir ]]
        then
                cd $(cat $tmpfile)
        fi
        rm -i -f "$tmpfile"
}

from joshuto.

ztlevi avatar ztlevi commented on July 27, 2024

@kamiyaa Hi, did you happen to realize this approach? I would like to contribute but my rust language is poor...

from joshuto.

kamiyaa avatar kamiyaa commented on July 27, 2024

added via a600e13

Usage:

alias joshuto='joshuto --lastdir /tmp/$USER/joshuto-lastdir;
	LASTDIR="$(cat /tmp/$USER/joshuto-lastdir)";
	[ "$LASTDIR" != "$(pwd)" ] && cd "$LASTDIR"';

Feel free to re-open if there are still issues

from joshuto.

liamtimms avatar liamtimms commented on July 27, 2024

Hi, I'm testing Joshotu after hitting some issues with Ranger. It's unclear how to currently enable this behavior effectively. I assume this is given as an alias to simply add to .bashrc, but the actual command in joshuto --help seems to be --last-dir <last-dir>, which doesn't make sense with the usage alias given here. It's not clear from --help what the --last-dir option actually does or what should be entered as the into <last-dir> when calling the option.

from joshuto.

ztlevi avatar ztlevi commented on July 27, 2024

@liamtimms you can checkout my setup https://github.com/ztlevi/dotty-config/blob/main/shell/joshuto/rc.zsh. But agree, this part need clearer documentation

from joshuto.

liamtimms avatar liamtimms commented on July 27, 2024

Thanks, it seems I had to switch to the git version to get that to work, but I did adapt it to work now. It definitely would benefit from more information in --help or the addition of a man page.

from joshuto.

kamiyaa avatar kamiyaa commented on July 27, 2024

Hey, everything should be documented under docs/

For example, https://github.com/kamiyaa/joshuto/blob/main/docs/configuration/keymap.toml.md#general
explains the new behavior of the quit command.

If you feel this is not enough documentation, feel free to add to it.
I'm also open to the idea of a manpage or making --help more useful. 👍

from joshuto.

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.