Giter Club home page Giter Club logo

Comments (7)

tswicegood avatar tswicegood commented on May 10, 2024

Paging @erichs (since he's the one who implemented this).

@AjayGavankar What is your $TERM variable set to? I just disabled and re-enabled dirs on my system with no problem.

from bash-it.

erichs avatar erichs commented on May 10, 2024

Interesting. For reference, here's the code in question:

    if [ "$1" = "all" ]; then
        typeset f plugin;
        for f in $BASH_IT/plugins/available/*.bash;
        do
            plugin=$(basename $f);
            if [ ! -h $BASH_IT/plugins/enabled/$plugin ]; then
                ln -s $BASH_IT/plugins/available/$plugin $BASH_IT/plugins/enabled/$plugin;
            fi;
        done;
    else
        typeset plugin=$(ls $BASH_IT/plugins/available/$1.*bash 2>/dev/null | head -1);
        if [ -z "$plugin" ]; then
            printf '%s\n' 'sorry, that does not appear to be an available plugin.';
            return;
        fi;
        plugin=$(basename $plugin);
        if [ -e $BASH_IT/plugins/enabled/$plugin ]; then
            printf '%s\n' "$1 is already enabled.";
            return;
        fi;
        ln -s $BASH_IT/plugins/available/$plugin $BASH_IT/plugins/enabled/$plugin;
    fi;

@AjayGavankar, when you do this:

target=git
plugin=$(ls $BASH_IT/plugins/available/$target.*bash 2>/dev/null | head -1)
echo "XXX${plugin}XXX"

what do you see?

from bash-it.

ajy avatar ajy commented on May 10, 2024

thanks for the quick reply
@tswicegood my $TERM is set to xterm
@erichs running your code gives me this-
"XXX/home/my_username/.bash_it/plugins/available/git.plugin.bashXXX"

have tried more stuff, enabling all plugins works perfectly, except for the clash between fasd and z.

and inserting these statements
echo $plugin echo $BASH_IT/plugins/available/$plugin echo $BASH_IT/plugins/enabled/$plugin
just before the ln command gives this when i try to enable dirs

dirs.plugin.bash
/home/my_username/.bash_it/plugins/available/dirs.plugin.bash
/home/my_username/.bash_it/plugins/enabled/dirs.plugin.bash

which looks right, so i'm guessing the ln command is screwing up somehow, but typing out the ln command in the terminal creates the symlink perfectly and enables the plugin.

weirdest thing i have ever seen

from bash-it.

erichs avatar erichs commented on May 10, 2024

Assuming you've tried closing your terminal and re-opening it?

"?[0m" is likely an ANSI escape sequence gone astray. What theme and prompt code are you using?

Also, what happens if you:

$ rm -rf $BASH_IT/plugins/enabled
$ mkdir $BASH_IT/plugins/enabled
$ enable-plugin base
$ ls -l $BASH_IT/plugins/enabled

from bash-it.

ajy avatar ajy commented on May 10, 2024

yeah tried closing the terminal and re-opening it.
I'm using the zork theme.
The output of those commands is:
total 0
lrwxrwxrwx 1 aj aj 56 May 20 12:15 "base.plugin.bash?[0m" -> "/home/aj/.bash_it/plugins/available/base.plugin.bash?[0m"

with the things in quotes getting highlighted red in my solarized terminal, which i think means the symlink is broken

from bash-it.

erichs avatar erichs commented on May 10, 2024

Ok, thanks!

Try changing your theme. Does that help?

Try replacing this line:

typeset plugin=$(ls $BASH_IT/plugins/available/$1.*bash 2>/dev/null | head -1)

with this:

typeset plugin=$(ls $BASH_IT/plugins/available/$1.plugin.bash 2>/dev/null | head -1)

does that work?

If not, try replacing it with this:

typeset plugin=$(command ls $BASH_IT/plugins/available/$1.*bash 2>/dev/null | head -1)

If any of those suggestions fix your issue, I'd like to know which.

from bash-it.

ajy avatar ajy commented on May 10, 2024

Hey, thanks for figuring it out, the last one did the trick .i.e.

typeset plugin=$(command ls $BASH_IT/plugins/available/$1.*bash 2>/dev/null | head -1)

Works for all the plugins above that didn't work before

from bash-it.

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.