Comments (6)
Right, I missed that you're probably running PS Core, hence it looks in $HOME\Documents\PowerShell
not $HOME\Documents\WindowsPowerShell
(but note that PS will load both $HOME\Documents\PowerShell\Profile.ps1
and $HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
). I'm not sure if it's broot's job to fix this. Plus from a brief look over the code, it could be non-trivial to implement because the installation doesn't run in the shell but in Rust, and I'm not sure if that somehow has access to the shell which launched it somehow: ideally this should access $PSVersionTable
or similar to check what it's being ran on.
Anyway, the typical fix for this PS/PS Core discrepancy is symlinking the WindowsPowershell to the Powershell directory or vice-versa.
from broot.
I'd like rusticians with knowledge of Windows to have a look there.
from broot.
However, my Profile file is different:
But br
still works, right?
So imo what broot does here is correct, and the best option as well.
from broot.
But
br
still works, right?
Unfortunately no, I had to manually source the broot ps1 script in my $PROFILE
, then br
started working.
from broot.
I think we should be revisiting this; the install script is currently in a broken state anyway* and we need to get eyes on it.
*: Last I checked, needs to be installed twice before br works, and then br will have you install it a third time 🤪
Note: PScore is typically referred to as pwsh, while the version currently bundled with Windows is referred to as WindowsPowerShell. This will be the familiar nomenclature to anyone who opted to install pwsh.
I propose the following change:
- Respect the $PROFILE env var. Do not just assume profile.ps1. It creates unnecessary clutter and confusion. If we're using
Microsoft.PowerShell_profile.ps1
then that's what you should be patching. I'd also suggest that the above should be the preferred default instead ofProfile.ps1
, when creating the profile for the user. - If the user has pwsh, patch pwsh and not WindowsPowerShell, unless maybe we're willing to add a y/n prompt, or implement more involved logic to detect if symlinks/sourcing are in play.
By the by,
Instead of symlinking, you may want to /source/ one profile from the other. Also, implement guard statements for things that are not supported in the older powershell 5.
If ((Get-Host).version.major -gt 5) {
// this won't run in powershell 5
}
from broot.
A focused PR not touching other systems could be welcome here.
from broot.
Related Issues (20)
- UTF-8 split codepoints HOT 6
- gitignore inconsistencies HOT 4
- Open File issue with broot HOT 9
- Navigate through files in the same level
- $EDITOR env variable ignored HOT 5
- `br` command fails on Windows HOT 19
- Image preview in kitty is slow HOT 2
- Clarify docs regarding `default_flags` usage HOT 2
- automatic title update when changing focused directory
- gitignore inconsistencies HOT 4
- Nushell's def-env command is deprecated HOT 6
- br can't be launched in a kitty startup session HOT 4
- Optionally use system trash implementation when using `rm` HOT 1
- Pressing `right` to open file leaves a `xdg-open` zombie process HOT 2
- shell command without quitting HOT 1
- For a symlink to another partition, opening it in a new panel shows a wrong fs size HOT 6
- broot hangs on a large nested directory HOT 1
- actions on new panel broken on windows since 1.30 HOT 2
- When creating a new pane under Windows, the path contains garbage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broot.