CDW (Change Directory (cd) for Windows path) is a powerful and user-friendly command-line tool that seamlessly bridges the gap between Windows and WSL (Windows Subsystem for Linux) file systems. Say goodbye to the hassle of manually converting Windows paths to WSL paths, just copy your windows path! π
- π Effortlessly convert Windows paths to WSL paths
- π Change directory using Windows-style paths in WSL
- π Support for multiple shells (Bash, Zsh, Fish, PowerShell, Nushell, Xonsh and Sh)
- π Easy installation and setup
- π‘ Intelligent shell detection
- π Verbose mode for detailed output
- π οΈ Convert paths without changing directory
- π¨ Customizable shell functions
-
Install CDW using Cargo:
cargo install cdw -
Initialize CDW for your shell:
cdw --init -
Restart your shell or source your shell's configuration file as outputed
-
Start using CDW:
cdw C:\Users\YourName\Documents
-
Clone the repository:
git clone https://github.com/aarmn/cdw.git -
Build the project:
cd cdw cargo build --release -
Move CDW to a folder included in PATH environmental variable:
sudo cp ./target/release/cdw /bin/cdw -
Initialize CDW for your shell:
cdw --init -
Restart your shell or source your shell's configuration file.
-
Start using CDW:
cdw C:\Users\YourName\Documents
cdw [OPTIONS] [PATH]
-i,--init: Initialize shell function--init-all: Initialize shell function for all available shells--init-display <SHELL>: Display shell function for a specific shell-v,--verbose: Enable verbose mode-c,--convert: Convert path without changing directory--help: Display help information
# Change directory to a Windows path
cdw 'C:\Users\YourName\Documents' # using `'` is necessary in bash for `\` to be interpreted as raw string and remain unescaped, check your shells for more info on raw/unescaped strings
# Convert a Windows path to WSL path without changing directory
cdw -c D:\Projects\MyProject
# Initialize CDW for your current shell
cdw --init
# Display the shell function for Zsh
cdw --init-display zsh
# Initialize CDW for all shells available (π§WIP)
cdw --init-all| Shell | Escape char (non N/A) | Space support without escaping backslash | Example |
|---|---|---|---|
| xonsh | nothing or r"" or r'' | β | cdw C: (: and \ terminated paths issue) or cdw r"C:\" or cdw r'C:\' |
| bash | '' | β | cdw 'C:\' |
| nushell | nothing | β | cdw C:\ |
| fish | nothing | β | cdw C: (: and \ terminated paths issue) |
| sh/dash | '' | β | cdw 'C:\' |
| zsh | '' | β | cdw 'C:\' |
| powershell | nothing | β | cdw C:\ |
- Bash
- Zsh
- Fish
- PowerShell
- Nushell
- Xonsh
- Sh (π§WIP)
CDW automatically creates shell-specific functions and autocompletion scripts in ~/.config/cdw/. You can customize these files to fit your needs. Just be careful, by calling init and init-all flags, it will be overwritten.
- The
--init-allfeature is currently a work in progress. - CDW is currently a drop-in replacement for
cd, but without support forcdflags, as they are rarely used. - CDW may not work correctly if you have
:or\in your file names. This limitation is acknowledged and may be addressed in future versions. - Lack of a clear raw-string syntax in some shells, makes it hard to pass paths containing spaces without escaping
\. I dedicated a row in table, for reporting shells support of raw-string and backslash terminated paths execution with ease.
- Add and stablize autocomplete for all supported shells
- Implement autocomplete for files, in shells possible
- Add a "no auto-complete" mode
- Omit all remenents or completely support
ksh - Make CDW a drop-in replacement of the system's
cdcommand (activate only if using Windows-style path, pass unknown flags downstream, test for no collision with cd flags in common shells) - Address the issue with files containing
:and\in their names in linux, in possible drop-in replacement solutions. - Cleanup code and make enum the passing data structure for shell type, not string or &str
- Document code for rustdoc
- Add unit tests
- Make lib.rs
- Space issues with using raw strings
- Clipboard and shortcut service app
- Add bookmarking and jump-like fast cd features (Maybe!)
- Github actions setup
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to all the contributors and users who have helped improve CDW!
Made with β€οΈ by Aryan L. Horizon (AARMN)
π If you find CDW useful, please consider giving it a star on GitHub! π