Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doskey macros not working in pipes #539

Open
elig0n opened this issue May 17, 2020 · 9 comments
Open

doskey macros not working in pipes #539

elig0n opened this issue May 17, 2020 · 9 comments

Comments

@elig0n
Copy link

elig0n commented May 17, 2020

Running Clink v0.4.9 [git:2fd2c2] on Windows 10 Pro 1909 Build 18363.815
Any macro that comes after the pipe symbol (|) in a command line is not interpreted.

@garoto
Copy link

garoto commented May 17, 2020

You cannot pipe the output of a command to a doskey macro. It was never a thing.

@chrisant996
Copy link

The chrisant996/clink fork supports it, when the doskey.enhanced setting is enabled (and it is enabled by default).

@iamqiz
Copy link

iamqiz commented Aug 28, 2024

@chrisant996 could you give a example for that ? thanks

@chrisant996
Copy link

@chrisant996 could you give a example for that ? thanks

I don't know what you're asking.

Also, this repo is abandoned.

The chrisant996 fork has tons of improvements from the past few years.

@iamqiz
Copy link

iamqiz commented Aug 28, 2024

@chrisant996 doskey support pipe in clink ?

C:\Users\pcmsi>doskey test1=echo a "$1" b

C:\Users\pcmsi>test1
a "" b

C:\Users\pcmsi>where cmd|test1
'test1 'is not an internal or external command, nor is it a runnable program

C:\Users\pcmsi>echo "123"|test1
'test1 'is not an internal or external command, nor is it a runnable program

what I expect to ouput is : a "C:\Windows\System32\cmd.exe" b and a "123" b

can clink do that? thanks!

@chrisant996
Copy link

Yes.

But you're using the old abandoned 0.4.9 from this repo, from 8+ years ago.

You need to upgrade to the current fork.

@iamqiz
Copy link

iamqiz commented Aug 28, 2024

@chrisant996 I am using chrisant996/clink v1.6.21.f97375,

C:\Users\pcmsi\tmp>doskey test1=echo a "$1" b

C:\Users\pcmsi\tmp>where cmd
C:\Windows\System32\cmd.exe

C:\Users\pcmsi\tmp>where cmd|test1
'test1 'is not an internal or external command, nor is it a runnable program

C:\Users\pcmsi\tmp>clink --version
1.6.21.f97375

@chrisant996
Copy link

First:

If you're using Clink v1.6.x then you're posting in the wrong repo. You're posting in the mridgers v0.4.9 repo right now. You should post in the chrisant996 fork repo instead.

Second:

Oh, you're using a complex doskey alias that uses $1 followed by other text. I think there's no good way to make that work how you want without breaking other kinds of complex doskey macros.

For example, issue chrisant996/clink#187 has a long discussion about related complexities.

The enhanced doskey alias functionality is only able to support simpler macros.

@chrisant996
Copy link

Oh, you're using a complex doskey alias that uses $1 followed by other text. I think there's no good way to make that work how you want without breaking other kinds of complex doskey macros.

Oops, I'm sorry, I was reading on my phone before, and I misread.

I had thought the macro was on the left side of the pipe -- my comment about "complex doskey alias" does not apply to your case, because you used the doskey alias is on the right side of the pipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants