Skip to content

Commit f5a3cb5

Browse files
authored
Merge pull request #3 from waf/powershell-support
Powershell support
2 parents f058e5e + d501054 commit f5a3cb5

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

README.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,63 @@
1-
# Dracula for [cmd](https://en.wikipedia.org/wiki/Cmd.exe)
1+
# Dracula for the Windows 10 Console
22

3-
> A dark theme for [cmd.exe](https://en.wikipedia.org/wiki/Cmd.exe).
3+
> A dark theme for the Windows 10 Console, supports both [cmd.exe](https://en.wikipedia.org/wiki/Cmd.exe) and [PowerShell](https://github.com/PowerShell/PowerShell)
44
55
![Screenshot](https://raw.githubusercontent.com/waf/dracula-cmd/master/images/screenshot.png)
66

7-
## Install
7+
<p align="center"><i>git integration is available only in powershell via posh-git</i></p>
88

9-
1. [Download and extract](https://raw.githubusercontent.com/waf/dracula-cmd/master/dist/ColorTool.zip) or [compile](https://github.com/Microsoft/console/tree/master/tools/ColorTool) ColorTool (from Microsoft).
10-
1. Run `ColorTool.exe -b Dracula.itermcolors`. The Dracula.itermcolors file is an iterm theme modified to work for cmd.exe.
11-
1. Right-click on the cmd.exe titlebar and choose `Properties`, then on the `Font` tab choose Consolas. Click `OK` to save.
12-
1. Optionally, set the `prompt` environment variable to `$E[0;32;40m→ $E[0;36;40m$p$E[0;35;40m› $E[0;38;40m` to get the prompt in the screenshot.
9+
## Theme Installation
10+
11+
1. [Download and extract](https://raw.githubusercontent.com/waf/dracula-cmd/master/dist/ColorTool.zip) ColorTool. The [source code](https://github.com/Microsoft/console/tree/master/tools/ColorTool) is available from Microsoft.
12+
1. Open cmd.exe and run `ColorTool.exe -b Dracula.itermcolors`. The Dracula.itermcolors file is an iterm theme modified to work for the windows console.
13+
1. Right-click on the window titlebar and choose `Properties`, then on the `Font` tab choose Consolas. Click `OK` to save.
14+
- Note that this step is required, even if your font is already set to Consolas, due to the way that the windows console saves its settings.
15+
16+
Perform the same steps above, but in a powershell window, for powershell support.
17+
18+
## cmd.exe prompt
19+
20+
1. After installing the theme, set the `prompt` environment variable to `$E[0;32;40m→ $E[0;36;40m$p$E[0;35;40m› $E[0;38;40m` to get the prompt in the screenshot.
1321
- In the start menu, search for "Edit environment variables for your account."
1422
- Add a new user variable named `prompt` with the above value.
1523

16-
### Explanation of prompt environment variable
24+
## PowerShell prompt
25+
26+
1. Install the 1.0 version of posh-git.
27+
- It's currently prerelease, so you'll need to install it with `Install-Module -Name posh-git -AllowPrerelease -Force`
28+
- If you don't have an `-AllowPrerelease` flag, upgrade PowerShellGet with `Install-Module -Name PowerShellGet -Force` first.
29+
1. Ensure the latest version of PSReadLine is installed. It's installed by default in Windows 10, but you'll most likely [need to upgrade it](https://github.com/lzybkr/PSReadLine#user-content-upgrading).
30+
1. Append the following lines to your [PowerShell $profile file](https://ss64.com/ps/syntax-profile.html):
31+
32+
```powershell
33+
# Dracula PSReadline Configuration
34+
Set-PSReadlineOption -TokenKind Parameter -ForegroundColor Gray
35+
Set-PSReadlineOption -TokenKind Command -ForegroundColor Green
36+
# Dracula Prompt Configuration
37+
$GitPromptSettings.DefaultPromptPrefix.Text = "$([char]0x2192) " # arrow unicode symbol
38+
$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Green
39+
$GitPromptSettings.DefaultPromptPath.ForegroundColor =[ConsoleColor]::Cyan
40+
$GitPromptSettings.DefaultPromptSuffix.Text = "$([char]0x203A) " # chevron unicode symbol
41+
$GitPromptSettings.DefaultPromptSuffix.ForegroundColor = [ConsoleColor]::Magenta
42+
# Dracula Git Status Configuration
43+
$GitPromptSettings.BeforeStatus.ForegroundColor = [ConsoleColor]::Blue
44+
$GitPromptSettings.BranchColor.ForegroundColor = [ConsoleColor]::Blue
45+
$GitPromptSettings.AfterStatus.ForegroundColor = [ConsoleColor]::Blue
46+
```
47+
48+
## Frequently Asked Questions
49+
50+
### After applying the theme, other consoles don't always have the right colors.
51+
52+
There are two possible reasons for this:
53+
54+
1. Step 3 from the theme installation was not followed; it's a requirement for the way that the windows console properties save settings.
55+
1. The shortcut used to apply the theme was different from shortcut used to open the console.
56+
- The windows console stores its font / color settings in per-shortcut. You can see / delete the special cases in the registry, in `\HKEY_CURRENT_USER\Console\` so the defaults are used.
57+
58+
### What's that crazy cmd.exe prompt string?
1759

18-
The prompt value above can be broken down into the following [ANSI escape sequences](http://ascii-table.com/ansi-escape-sequences.php):
60+
The cmd.exe prompt value can be broken down into the following [ANSI escape sequences](http://ascii-table.com/ansi-escape-sequences.php):
1961

2062
- `$E[0;32;40m` - normal text with a green foreground and black background
2163
- `` - unicode arrow and space

images/screenshot-noblur.png

66.4 KB
Loading

images/screenshot.png

5.85 KB
Loading

0 commit comments

Comments
 (0)