https://github.com/radad/radline
Improved command line completion for cmd.exe
https://github.com/radad/radline
appveyor cmd console win32 windows
Last synced: 4 months ago
JSON representation
Improved command line completion for cmd.exe
- Host: GitHub
- URL: https://github.com/radad/radline
- Owner: RadAd
- Created: 2019-06-06T01:07:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-15T03:31:49.000Z (6 months ago)
- Last Synced: 2025-05-18T22:14:15.641Z (5 months ago)
- Topics: appveyor, cmd, console, win32, windows
- Language: C++
- Homepage:
- Size: 1.18 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RadLine
=======Improved command line completion for cmd.exe

[](https://github.com/RadAd/RadLine/releases/latest)
[](https://github.com/RadAd/RadLine/commits/master)
[](https://ci.appveyor.com/project/RadAd/RadLine)Dependencies
-------[](https://github.com/m417z/minhook/commits/multihook/)
Details
-------`RLoadDll.exe` injects the `RadLine.dll` into `cmd.exe` process.
On startup the `RadLine.dll` replaces the `ReadConsole` function with its own. This allows it to intercept the command line completion behaviour.
Command line completion
-----------------------This was the main reason for creating this utility. Completion is looked up using the lua script [RadLine.lua](RadLine.lua).
The function `FindPotential` is called with the current command line and returns an array of potential matches.
The matches are then listed under the current line.Auto terminate batch file
-------------------------To enable:
```
set RADLINE_AUTO_TERMINATE_BATCH=1
```This setting will auto-respond `y` to the `Terminate batch job (Y/N)?` prompt.
Expand Tilde
------------The `~` at the start of an argument is expanded to `%USERPROFILE%`.
Pre command execution
----------------------The contents of the environment variable `RADLINE_PRE` are prepended to the current command.
For example:
```
set RADLINE_PRE=echo Start
```Post command execution
----------------------The contents of the environment variable `RADLINE_POST` are appended to the current command.
For example:
```
set RADLINE_POST=echo Error: ^%ERRORLEVEL^%
```Dynamic environment variables
-----------------------------`__PID__` will show the process id of the cmd process.
`PROMPT` environment variables in the prompt variable will also be expanded.
`set foo=%(cmd /c echo bar)%` the command in the brackets will expand to the output of the command.
Install
-------To install, download the [zip](https://github.com/RadAd/RadLine/releases/latest) and decompress to `%APPDATA%\Radsoft\RadLine`
Add the following lines to your cmd startup script:
```
set RADLINEDIR=%APPDATA%\Radsoft\RadLine
"%RADLINEDIR%\RLoadDll.exe" /d - "%RADLINEDIR%\RadLine.dll"
```