chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.44k stars 135 forks source link

Problem when is "autorun install" when run a batch script get a "♀" (a extrac char on output -> ♀) #624

Closed Mitezuss closed 2 months ago

Mitezuss commented 2 months ago

A image:

0

that char appear when is running a batch script, like:

@echo Off
for /f "delims=" %%i in ('dir "%~1\*.txt" /s /b') do ( echo "%%~i" )
pause

only when is "installed" clink (with autorun install option) how can be fixed ?

Regards

chrisant996 commented 2 months ago

I cannot reproduce the issue.

c:\wbin\clink> test\issue624.cmd c:\tmp\
"c:\tmp\.inputrc.txt"
"c:\tmp\4115292.body.txt"
"c:\tmp\adminstatus_20220928_1412.txt"

Can you share more information?

Clink can't affect batch scripts -- it can only affect the prompt and the input line. CMD doesn't give Clink any opportunities to affect batch scripts (even if Clink wanted to, but it doesn't want to).

Either the effect is coming from something else, or there is more involved than just Clink and the batch script.

chrisant996 commented 2 months ago

Also, the character is the "FF" or "Form Feed" character, which tells a printer to scroll to the top of the next page (i.e. when printing onto paper). Different terminal programs behave differently when the Form Feed character is present.

That's not something Clink ever uses. But again, Clink isn't active while CMD is running a batch script, so either the effect isn't coming from Clink, or there is more involved than just Clink and the batch script.

Mitezuss commented 2 months ago

@chrisant996

hi, thank for the reply

Latest Clink on Windows 7 x64

Clink OFF: off

Clink ON: Just drag and drop the folder on the file.bat drag-drop on

From command line command-line


And I don't have an example at this time, but with "invoke" also happens: When I want to get a value of the output of a program that runs a CMD command, get the extra char

Regards (sry my bad english)

chrisant996 commented 2 months ago

Ok, that's very helpful information.

The issue is occurring when the for command spawns a new cmd.exe to run the command in the parentheses, for example ('dir "%~1\*.txt" /s /b').

That command is printing a Form Feed character before anything else.

Can you run clink autorun show and share the output?

Mitezuss commented 2 months ago

Can you run clink autorun show and share the output?

Current AutoRun values
  Current user:
    native : "C:\Windows\Tools\Clink\clink.bat" inject --autorun
     wow64 : "C:\Windows\Tools\Clink\clink.bat" inject --autorun
  All users:
    native : <unset>
     wow64 : <unset>

So the problem was on my clink.bat (my mistake). Fixed Thank =]