Git Product home page Git Product logo

Comments (6)

chrisant996 avatar chrisant996 commented on September 24, 2024 1

Ok thanks. It's the case I guessed. Clink should check whether there's an alias for cd that expands to run something other than cd, and if so then it shouldn't intercept at all.

Also, it should check for & or | after the cd blah_whatever command, and if present then it also shouldn't intercept.

from clink.

chrisant996 avatar chrisant996 commented on September 24, 2024

This sounded related to something I saw with cd-deluxe in the past. I tracked down my memory to shunsambongi/clink-zoxide#5 which was opened by you, and we had a conversation there.

There isn't a way to turn off directory intercept.

Can you share what isn't working? With some information about your macros and scripts and what isn't working, it would be possible to fix the problems that they're experiencing.

from clink.

chrisant996 avatar chrisant996 commented on September 24, 2024

Specifically what "doesn't work"?

The only thing I can think of is that you want cd - to be handled by your cd alias, so that cdd - is invoked and the "go to previous directory" is handled by CD-Deluxe instead of by Clink, so that the side effects happen such as setting %OLDPWD%.

I think the issue is that in addition to checking for "cd" or "chdir", Clink should also first confirm that there isn't a corresponding doskey macro.

Can you share what problem(s) you've encountered?

from clink.

eggbean avatar eggbean commented on September 24, 2024

Sorry, I had to commit some changes before replying.

This is my modified version of the cdd.cmd script which is aliased to cd (original is here):

@echo off
set dest=%*
if '%dest%'=='' goto :cdd
if qq%dest:~0,1%%dest:~-1%qq == qq""qq set dest=%dest:~1,-1%
if '%dest:~0,1%' == '~' set dest=%USERPROFILE%%dest:~1%
set dest="%dest%"
set OLDPWD="%CD%"
:cdd
set pushd_tmp=%TEMP%\pushd.tmp
set cdd_tmp_cmd=%TEMP%\cdd.tmp.cmd
pushd > %pushd_tmp%
%~dps0_cdd.exe %dest% < %pushd_tmp% > %cdd_tmp_cmd%
set dest=
%cdd_tmp_cmd%

The set OLDPWD="%CD%" works in every case apart from when the original command is cd -, where the script is bypassed altogether. (This doesn't otherwise disrupt the working of CD Deluxe though.)

from clink.

chrisant996 avatar chrisant996 commented on September 24, 2024

I updated the title to describe the issue.

from clink.

eggbean avatar eggbean commented on September 24, 2024

Excellent, thanks.

from clink.

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.