Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 947396 - app-misc/broot: "Broot should be launched using a shell function" looks like broken: still no br command
Summary: app-misc/broot: "Broot should be launched using a shell function" looks like ...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Karl-Johan Karlsson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-03 15:56 UTC by Vitaly Zdanevich
Modified: 2025-01-03 18:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Zdanevich 2025-01-03 15:56:22 UTC
After emerge I ran 

$ broot 

Broot should be launched using a shell function.
This function most notably makes it possible to cd from inside broot
(see https://dystroy.org/broot/install-br/ for explanations).

Can I install it now? [Y/n]
 
Writing br shell function in /home/vitaly/.local/share/broot/launcher/bash/1.
Creating link from /home/vitaly/.config/broot/launcher/bash/br to /home/vitaly/.local/share/broot/launcher/bash/1.
/home/vitaly/.zshrc successfully patched, you can make the function immediately available with exec zsh

The br function has been successfully installed.
You may have to restart your shell or source your shell init files.
Afterwards, you should start broot with br in order to use its full power.

And in new terminal - still no br command.

And bash is my default shell, not zsh.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-03 15:57:01 UTC
It looks like it setup both bash *and* zsh.
Comment 2 Karl-Johan Karlsson 2025-01-03 16:32:25 UTC
It's installed the files containing the "br" shell function, but when it came to changing the shell configuration, it only did so for zsh.

When I run the installer, I get these lines instead:

/home/creideiki/.bashrc successfully patched, you can make the function immediately available with source /home/creideiki/.bashrc
/home/creideiki/.bash_profile successfully patched, you can make the function immediately available with source /home/creideiki/.bash_profile

(and nothing for zsh, since I do not use zsh and do not have a ~/.zshrc file)

It looks for the files ~/.bashrc and ~/.bash_profile to patch ( https://github.com/Canop/broot/blob/805c943964ca8f40e55e37f5f1f6867d326f668f/src/shell_install/bash.rs#L29 ). Do you have these files?

If you run:

   BROOT_LOG=debug broot --install

that will try to re-install the shell function and write a debug log file, broot.log. What does that log file say?
Comment 3 Vitaly Zdanevich 2025-01-03 17:31:24 UTC
Solved on my side by adding manually to bashrc this line

source /home/vitaly/.config/broot/launcher/bash/br

copied from ~/.zshrc

-----

Side question - no way to format a code here? No markdown?
Comment 4 Vitaly Zdanevich 2025-01-03 17:32:34 UTC
$ BROOT_LOG=debug broot --install
You requested a clean (re)install.
Removing /home/vitaly/.config/broot/launcher/installed-v4.
Removing /home/vitaly/.local/share/broot/launcher/bash/1.
Writing br shell function in /home/vitaly/.local/share/broot/launcher/bash/1.
Removing /home/vitaly/.config/broot/launcher/bash/br.
Creating link from /home/vitaly/.config/broot/launcher/bash/br to /home/vitaly/.local/share/broot/launcher/bash/1.
/home/vitaly/.zshrc already patched, no change made.

The br function has been successfully installed.
You may have to restart your shell or source your shell init files.
Afterwards, you should start broot with br in order to use its full power.
Comment 5 Vitaly Zdanevich 2025-01-03 17:37:34 UTC
> It looks for the files ~/.bashrc

Of root? Or all users?

I have them at /etc/bash/bashrc.d/
Comment 6 Karl-Johan Karlsson 2025-01-03 18:06:17 UTC
(In reply to Vitaly Zdanevich from comment #5)
> > It looks for the files ~/.bashrc
> 
> Of root? Or all users?

No, in the home directory of the user running broot. Judging from the other output, ~ is /home/vitaly/ for you.

> I have them at /etc/bash/bashrc.d/

The usual setup is to only have system-wide configuration in /etc, and user-specific configuration in ~. broot only tries to alter the user-specific configuration in ~. The text printed contains enough information for you to add the configuration manually if you keep your user-specific configuration in a non-standard location.