|
1 | | -# Dracula for the Windows 10 Console |
| 1 | +# Dracula for the PowerShell Console |
2 | 2 |
|
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) |
| 3 | +> A dark theme for the Windows 10 Console, supports both [PowerShell](https://github.com/PowerShell/PowerShell) and [cmd.exe](https://en.wikipedia.org/wiki/Cmd.exe). |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
7 | 7 | <p align="center"><i>git integration is available only in powershell via posh-git</i></p> |
8 | 8 |
|
9 | 9 | ## Theme Installation |
10 | 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.ini`. |
| 11 | +1. [Download and unzip](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 PowerShell, navigate to unzipped `ColorTool` directory, and run `ColorTool.exe -b Dracula.ini`. |
13 | 13 | 1. Right-click on the window titlebar and choose `Properties`, then on the `Font` tab choose Consolas. Click `OK` to save. |
14 | 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 | 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[1;32;40m→ $E[1;36;40m$p$E[1;35;40m› $E[1;37;40m` to get the prompt in the screenshot. |
21 | | - - In the start menu, search for "Edit environment variables for your account." |
22 | | - - Add a new user variable named `prompt` with the above value. |
| 16 | +For cmd.exe support, perform the same steps above but in a cmd.exe window. |
23 | 17 |
|
24 | 18 | ## PowerShell prompt |
25 | 19 |
|
26 | 20 | 1. Install the 1.0 version of posh-git. |
27 | 21 | - It's currently prerelease, so you'll need to install it with `Install-Module -Name posh-git -AllowPrerelease -Force` |
28 | 22 | - If you don't have an `-AllowPrerelease` flag, upgrade PowerShellGet with `Install-Module -Name PowerShellGet -Force` first. |
29 | 23 | 1. Ensure the latest version of PSReadLine (2.0 or later) 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. Put the following lines in your [PowerShell $profile file](https://ss64.com/ps/syntax-profile.html): |
31 | | - |
32 | | -```powershell |
33 | | -# Dracula readline configuration. Requires version 2.0, if you have 1.2 convert to `Set-PSReadlineOption -TokenType` |
34 | | -Set-PSReadlineOption -Color @{ |
35 | | - "Command" = [ConsoleColor]::Green |
36 | | - "Parameter" = [ConsoleColor]::Gray |
37 | | - "Operator" = [ConsoleColor]::Magenta |
38 | | - "Variable" = [ConsoleColor]::White |
39 | | - "String" = [ConsoleColor]::Yellow |
40 | | - "Number" = [ConsoleColor]::Blue |
41 | | - "Type" = [ConsoleColor]::Cyan |
42 | | - "Comment" = [ConsoleColor]::DarkCyan |
43 | | -} |
44 | | -# Dracula Prompt Configuration |
45 | | -Import-Module posh-git |
46 | | -$GitPromptSettings.DefaultPromptPrefix.Text = "$([char]0x2192) " # arrow unicode symbol |
47 | | -$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Green |
48 | | -$GitPromptSettings.DefaultPromptPath.ForegroundColor =[ConsoleColor]::Cyan |
49 | | -$GitPromptSettings.DefaultPromptSuffix.Text = "$([char]0x203A) " # chevron unicode symbol |
50 | | -$GitPromptSettings.DefaultPromptSuffix.ForegroundColor = [ConsoleColor]::Magenta |
51 | | -# Dracula Git Status Configuration |
52 | | -$GitPromptSettings.BeforeStatus.ForegroundColor = [ConsoleColor]::Blue |
53 | | -$GitPromptSettings.BranchColor.ForegroundColor = [ConsoleColor]::Blue |
54 | | -$GitPromptSettings.AfterStatus.ForegroundColor = [ConsoleColor]::Blue |
55 | | -``` |
| 24 | +1. Include [this powershell configuration](https://github.com/dracula/powershell/blob/master/theme/dracula-prompt-configuration.ps1) in your PowerShell `$profile` file.<sup>[1](#whats-the-powershell-profile-file "What's the PowerShell `$profile` file?")</sup> |
| 25 | + |
| 26 | +## cmd.exe prompt |
| 27 | + |
| 28 | +Set the environment variable `prompt` to `$E[1;32;40m→ $E[1;36;40m$p$E[1;35;40m› $E[1;37;40m` |
56 | 29 |
|
57 | 30 | ## Frequently Asked Questions |
58 | 31 |
|
| 32 | +### What's the PowerShell `$profile` file? |
| 33 | + |
| 34 | +This is a PowerShell file that's run when a PowerShell session is started, similar to a `.bashrc`. Type `$profile` in a PowerShell window to see the path. See https://ss64.com/ps/syntax-profile.html for more detail. |
| 35 | + |
59 | 36 | ### After applying the theme, other consoles don't always have the right colors. |
60 | 37 |
|
61 | 38 | There are two possible reasons for this: |
62 | 39 |
|
63 | 40 | 1. Step 3 from the theme installation was not followed; it's a requirement for the way that the windows console properties save settings. |
64 | 41 | 1. The shortcut used to apply the theme was different from shortcut used to open the console. |
65 | | - - The windows console stores its font / color settings in per-shortcut. You can see / delete the special cases in the registry. Go to `\HKEY_CURRENT_USER\Console\` and delete the subkeys so the default is used. |
| 42 | + - The windows console stores its font / color settings in per-shortcut. You can see / delete the special cases in the registry. Go to `\HKEY_CURRENT_USER\Console\` and delete the subkeys so the default values in the `Console` key are used. |
66 | 43 |
|
67 | 44 | ### What's that crazy cmd.exe prompt string? |
68 | 45 |
|
|
0 commit comments