Comments (10)
@chrisant996 hello, is there a setting to ignore leading spaces of doskey alias ?
from clink.
No. Doskey aliases are never expanded with a space before them.
Not by CMD.exe, not by Clink, not by the Windows OS.
from clink.
a workaround to strip leading spaces in current line is to
define a key bind in .inputrc :
"\e[27;8;65~":set-mark
"\e[27;8;66~":clink-forward-bigword
"\e[27;8;67~":kill-region
"\e[27;8;68~":end-of-line
"\e[27;8;69~":beginning-of-line
"\C-g\C-f":"\e[27;8;69~\e[27;8;65~\e[27;8;66~\e[27;8;67~\e[27;8;68~"
then use ctrl+g ctrl-f
to delete leading spaces.
(\e[27;8;65~
mean ctrl+shift+alt+a
, \e[27;8;66~
mean ctrl+shift+alt+b
,and so on
\C-g\C-f
do these action: beginning-of-line > set-mark>clink-forward-bigword >kill-region > end-of-line
)
@chrisant996 will you consider to create a command such as clink-delete-leading-space
to do that? ๐ฅฐ
from clink.
will you consider to create a command such as
clink-delete-leading-space
to do that?
Why would it be needed?
- It seems you've already accomplished what you wanted, using the tools already available.
- It's confusing why a mechanism to strip leading spaces is desired -- why insert the spaces in the first place, if the intent is to remove them?
from clink.
@chrisant996 sometimes the leading spaces will be insert by users accidently;
someone hope terminal allow leading space,
clink-delete-leading-space
maybe be useful for them (i guess)
from clink.
@chrisant996 sometimes the leading spaces will be insert by users accidently;
someone hope terminal allow leading space,
clink-delete-leading-space
maybe be useful for them (i guess)
If spaces were instead accidentally, then the user probably isn't aware that spaces were inserted, and they probably won't press a special key to remove them.
Input line coloring will typically help make it clear when an alias will not be expanded.
Windows doesn't expand aliases when preceded by a space. This is generally considered a feature, so that you can prevent using an alias. For example if you have an alias dir
that executes for example eza
or dir /w
. Then inserting a space lets you still be able to run literally dir
when you need to.
from clink.
(Also, the issue you cited from the terminal repo says a leaving space is meant to bypass expanding a doskey aliases, but there was a bug where it accidentally didn't. The bug was fixed a few years ago. I'm not sure why that issue was cited. It seems to agree with what I've been saying.)
from clink.
@chrisant996 ๐sorry, it is my mistake๐
thank you for your patient explanation.
you let me realize i misunderstood that issue's intention, ๐ because the word "bypass" is understood as "allow" by me๐ forgive my poor english๐
the example dir
alias you mentioned above is really a common use case, for me, i want to use cd
as a alias to cd /d
.
i also realize why clink allow to use a leading semicolon :
a printable leading char is better than a space to bypass doskey alias ๐
from clink.
Try starting cmd.exe
without Clink.
You will find that in cmd.exe
doskey aliases are not expanded if they are preceded by a space or semicolon (or several other kinds of punctuation characters).
The only part that's new in Clink is that by default a space prevents adding the command to history. And that is controllable by the Clink setting that you found.
So it seems like you're asking me to change how cmd.exe and Windows and the ReadConsole system API work, and make it behave different from how it's meant to behave. The stated motivation for such a change doesn't seem compelling.
I'm not going to do that. It would create even more confusion, and would break some workflows, and would make troubleshooting and support even harder.
from clink.
@chrisant996
i have tried it, you are right!
i no longer hope clink or cmd.exe to remove leading space , i realized that keeping it is meaningful
from clink.
Related Issues (20)
- some key work in linux, but no work in clink HOT 4
- Disable startup message HOT 2
- how to use `os.setalias()` HOT 1
- How change shortcut for Popup Windows HOT 19
- prompt shows leftover text sometimes HOT 2
- Modify Heading HOT 5
- the new `os.setalias` ignore the flags and args HOT 1
- Where to define environment variables in CMD or Clink? HOT 2
- Question: Expanding environment variables during auto complete HOT 9
- some problems HOT 1
- No message print when an update is available HOT 2
- Show history filtered by the typed command HOT 4
- The installer is not copying any files to the newly created %LOCALAPPDAT%\clink directory HOT 3
- What's the diffs to https://github.com/mridgers/clink? HOT 2
- Request: CTRL+D to exit terminal. HOT 4
- How to stop colors? HOT 6
- Change color for cmd command? HOT 7
- things not working HOT 2
- Proper way to update via scoop or clink update? HOT 7
- The last character of a right-aligned prompt gets erased HOT 4
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 clink.