-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
89 lines (65 loc) · 3.19 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmdEx: Fixes for cmd.exe
Scott Graham <[email protected]>
-------------------------------------
cmdEx makes some improvements to cmd.exe. Currently:
- In PROMPT, $M displays git branch information instead of its normal function.
- Improvements to input handling (set CMDEX_NOREADCONSOLE=1 to disable).
Keybindings:
- Alt-Up does "cd ..", maintaining current command.
- Ctrl-W deletes back a word, Ctrl-Backspace deletes back a path
component.
- Ctrl-V pastes, with confirmation if there's \n in the text.
- Alt-Left/Right or browser back/forward navigates like a web browser in
previously visited directories, maintaining current command.
- Improved tab completion, in addition to file and directory
(contextually), built-ins and commands in path are completed, git
subcommands are completed, and some git subcommands have arguments and
context-sensitive completion (e.g. "git checkout o<TAB>" might complete
to "git checkout origin/main"). Target names are also completed for
the ninja build tool. Environment variables are completed after "set".
- Ctrl-Enter opens an Explorer window in the current directory.
- Ctrl-L clears the console and puts the current command at the top of the
window.
- Ctrl-D at an empty prompt exits the shell.
- Escape clears the current line
- Ctrl-A/Ctrl-E are the same as Home/End.
- Ctrl-Left/Right jump by word
- Last 1000 commands are saved to %USERPROFILE%\_cmdex_history on 'exit',
and loaded on startup.
- Up, Down to move through history, PgUp/F8, PgDown to complete from
history based on current prefix.
- Ctrl-U/Ctrl-Home delete to beginning of line, Ctrl-K/Ctrl-End delete to
end of line.
TODO:
- There's a crash in Alt-Right sometimes. :( Not sure of repro.
- ninja && somethi<TAB> tries to complete targets, instead of commands.
- Ctrl-V multiline doesn't work properly, and needs tests.
- I keep wanting Ctrl-Del to do something, but I'm not sure what. I think
delete word to the right.
- Save history more often, and maybe share between instances somehow.
- Dir completion not excluding files?
- Some of the completer code in dll.cc can move to the lib and be tested.
- Add an option to automate adding/removing registry entry, and speed up
startup so that it's fast enough to be reasonable to do so.
cmdEx is currently only known to work on Windows 11 and using the x64 cmd.exe.
This is on the "main" branch which is the current development branch.
The last x86 version (any time before 2024) worked on Windows 7, 8, 8.1, and 10,
and only when using the x86 cmd.exe. This is still available on the old
"master" branch.
Run:
C:\...\cmdEx>out\cmdEx
[main]C:\...cmdEx>
Build:
Requires: git, cmake, devenv, python in path.
With VS2022 vars:
C:\...\cmdEx>python sng.py -u # -u pulls third_party dependencies
C:\...\cmdEx>third_party\ninja\ninja
Test:
C:\...\cmdEx>out\tests
C:\...\cmdEx>python test.py
C:\...\cmdEx>new
[main]C:\...\cmdEx>exit
Acknowledgements:
- src/cmdEx/subprocess* adapted from http://github.com/martine/ninja/.
- Similar project, but readline based: http://code.google.com/p/clink/. Some
of cmdEx's injection code is based on Clink's.