Code Monkey home page Code Monkey logo

Comments (12)

Schweber avatar Schweber commented on September 21, 2024 1

I'm now on nushell 0.91. and broot 1.36.0 and the problem remains. These are the lines from the log where the cd is called and fails:

08:11:14.642 [INFO] broot::app::app: key combination: Enter
08:11:14.642 [DEBUG] broot::command::panel_input: verb for key: cd {directory}
08:11:14.642 [DEBUG] broot::app::app: command after add_event: VerbTrigger { verb_id: 13, input_invocation: None }
08:11:14.642 [DEBUG] broot::verb::execution_builder: repl name : "directory"
08:11:14.642 [DEBUG] broot::app::app: cmd_result: Quit
08:11:14.642 [DEBUG] broot::task_sync: dead dam
08:11:14.642 [INFO] cli_log::mem: Physical mem usage: current=13M, peak=154M
08:11:14.642 [INFO] broot: bye

broot.log

from broot.

Schweber avatar Schweber commented on September 21, 2024 1

broot is not to blame, sorry. I had defined the alias in nushell config like this:

def a [] { br -gis }

This launched broot with the given flags but not the shell function somehow. If i do this instead:

alias a = br -gis 

everything works fine.

@FrancescElies @LudoPinelli @texastoland Is this behaviour to be expected from nushell or should it work in both instances?

from broot.

Schweber avatar Schweber commented on September 21, 2024 1

Yes, thank you for the explaination. I'll close this issue and make a PR to amend the documentation.

from broot.

Schweber avatar Schweber commented on September 21, 2024

Just to be sure: you launch br, not broot ?

Yes, just double checked.

from broot.

Canop avatar Canop commented on September 21, 2024

:open_leave isn't supposed (or able) to change the current directory of the opening shell.

Try with this:

{
    key: enter
    internal: open_leave
    apply_to: file
}
{
    key: enter
    external: "cd {directory}"
    from_shell: true
    apply_to: directory
}

from broot.

Schweber avatar Schweber commented on September 21, 2024

Unfortunately, it's not working. I had { key: "enter", from_shell: true, execution: "cd {directory}", set_working_dir: true } for some time as a workaround for fish but in nu it's not working at all.

Is there a way to get a verbose output of broot to see why it fails? I found no such cli option...

from broot.

Canop avatar Canop commented on September 21, 2024

Is there a way to get a verbose output of broot to see why it fails? I found no such cli option...

Yes, there's a log: https://dystroy.org/broot/community/#log

from broot.

Schweber avatar Schweber commented on September 21, 2024

Thanks, it says this:

12:09:01.636 [DEBUG] broot::command::panel_input: verb for key: cd {directory}
12:09:01.636 [DEBUG] broot::app::app: command after add_event: VerbTrigger { verb_id: 13, input_invocation: None }
12:09:01.636 [DEBUG] broot::verb::execution_builder: repl name : "directory"
12:09:01.636 [INFO] broot::app::panel_state: get_status cc.cmd=VerbTrigger { verb_id: 13, input_invocation: None }
12:09:01.636 [DEBUG] broot::app::app: cmd_result: Quit
12:09:01.636 [DEBUG] broot::task_sync: dead dam
12:09:01.636 [INFO] cli_log::mem: Physical mem usage: current=12M, peak=154M
12:09:01.636 [INFO] broot: bye

broot.log

from broot.

Canop avatar Canop commented on September 21, 2024

You don't have other verbs than the one I proposed mapped to the enter key ?

I'll have a deeper look and try on nushell but it won't be before a few days.

from broot.

Schweber avatar Schweber commented on September 21, 2024

No, no further mappings to enter, just the ones you posted in this tread.

I just added this to be sure:

{
    key: Tab
    internal: open_leave
    apply_to: file
}
{
    key: Tab
    external: "cd {directory}"
    from_shell: true
    apply_to: directory
}

but it also is not working for me.

from broot.

Schweber avatar Schweber commented on September 21, 2024

I updated to nushell 0.90.1 and broot 1.34.0 and reinstalled the br shell function but the problem is still there

from broot.

FrancescElies avatar FrancescElies commented on September 21, 2024

@Schweber I think this is spected because of nushell scoping rules, the environment changes inside your def function stay there and do not have side effects outside the funciton, try with def --env a [] { br -gis }.

def --env is also what we used to define the br wrapper for nushell, see here

Try this two functions, cd-tmp will change directory of your current shell but cd-root won't.

def --env cd-tmp [] { cd /tmp; ls }
def cd-root [] { cd /; ls }

Does this help?

from broot.

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.