Code Monkey home page Code Monkey logo

Comments (11)

vors avatar vors commented on August 23, 2024 1

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.

https://github.com/cmderdev/cmder/blob/4655888690cd807cd24b082509c1e65e0a4cca38/vendor/profile.ps1#L175

from zlocation.

glucas avatar glucas commented on August 23, 2024 1

@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.

vors avatar vors commented on August 23, 2024

hm, interesting, why cmder makes the promp function RO?

from zlocation.

michaeljones32 avatar michaeljones32 commented on August 23, 2024

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.

Kethku avatar Kethku commented on August 23, 2024

RO stands for read only.

from zlocation.

vors avatar vors commented on August 23, 2024

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.

Snaptags avatar Snaptags commented on August 23, 2024

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.

cspotcode avatar cspotcode commented on August 23, 2024

#48 offers a solution.

# In your profile:
Import-Module ZLocation -ArgumentList @{Register = $false}
Function PrePrompt {
    Update-ZLocation
}

from zlocation.

vors avatar vors commented on August 23, 2024

@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.

vors avatar vors commented on August 23, 2024

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.

vors avatar vors commented on August 23, 2024

Fixed

from zlocation.

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.