Comments (11)
Hm, looks like they left PrePrompt
/ PostPrompt
function for customization. It's probably easier to special-case cmder prompt (i.e. catch the error while changing prompt) and use one of this functions instead.
from zlocation.
@cspotcode Thanks, your PR works great for me. Here's the snippet I've got working in my cmder user-profile.ps1 (note the $pwd is important!):
[ScriptBlock]$PrePrompt = {
Update-ZLocation $pwd
}
from zlocation.
hm, interesting, why cmder makes the promp function RO?
from zlocation.
What is RO?
I was just running z and it threw that, just running standard cmder, never had any issues like this before
from zlocation.
RO stands for read only.
from zlocation.
I don't have a windows machine at the moment, if anybody can investigate and confirm this isssue, I'd very much appreciate it.
from zlocation.
Yes, I can confirm this. But as far as I am concerned this is a cmder problem. Handling the prompt itself is one of its main features:
…and a custom prompt layout.
https://github.com/cmderdev/cmder
This is from the profile.ps1 cmder uses for powershell:
<# This scriptblock runs every time the prompt is returned. Explicitly use functions from MS namespace to protect from being overridden in the user session. Custom prompt functions are loaded in as constants to get the same behaviour #>
Maybe editing the profile could work around the problem…
from zlocation.
#48 offers a solution.
# In your profile:
Import-Module ZLocation -ArgumentList @{Register = $false}
Function PrePrompt {
Update-ZLocation
}
from zlocation.
@cspotcode thank you for looking at it!
I think we can make UX here more seamless by special-casing cmder and handling it transparently for people.
from zlocation.
Hm, actually it was easier than I though: hint to use -Force
was below https://github.com/cmderdev/cmder/blob/4655888690cd807cd24b082509c1e65e0a4cca38/vendor/profile.ps1#L211
from zlocation.
Fixed
from zlocation.
Related Issues (20)
- Windows detection bug in Get-FrequentFolders HOT 2
- Error on new install of 1.4.1 HOT 2
- It would be great to see a list of most recent HOT 2
- [Feature Request] Allow installation via Chocolatey
- Set-ZLocation and Update-ZLocation break for PS 7 if the user has defined an alias for 'find' HOT 1
- How to exclude a directory from tracking? HOT 1
- Exception calling "Add" with "2" argument(s) - issue after updating powershell to 7.1 HOT 2
- [Feature Request] z partial/path/to/dir? HOT 1
- Doesn't work with posh-git's error reporting (DollarQuestion) HOT 3
- how can I unsinstall it?thanks. HOT 1
- Database has duplicate entries differing in case only
- Cannot z to network drives HOT 1
- Invoke-ZLocation doesn't work with oh-my-posh + posh-git + ZLocation HOT 2
- Question: possible to prefer child directories? HOT 1
- [Feature request] only display directories with tab completion HOT 5
- Duplicate Unc Paths in Database Where Only One Is Updated
- ZLocation not working as intended. HOT 6
- profile file flood
- Can't jump a folder with `[` or `]` in it
- Add option to customize db location HOT 1
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 zlocation.