Giter VIP home page Giter VIP logo

cmd-colors-solarized's People

Contributors

charles-hollenbeck avatar dahlbyk avatar jdagilliland avatar neilpa avatar ntwb avatar rbeesley avatar russwe avatar ryanbee-msft avatar shanselman avatar thebigbear avatar theunrepentantgeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmd-colors-solarized's Issues

Command paths not found on Windows 7

When running the script on Windows 7 with the following command:
Update-Link.cmd "c:\users\admin\alias\command.lnk" light

The following error results:
The term '\Get-Link.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Adding a '.' to the path in Update-Link.ps1 fixes the issue temporarily:
$lnk = & ("$PSScriptRoot\Get-Link.ps1") $Path
$lnk = & ("$PSScriptRoot.\Get-Link.ps1") $Path

There is probably a better way of doing this or setting PSScriptRoot to '.'

REG files are saved with UTF-8 BOM and cannot be imported. Must save with UTF-8

As title indicates, the REG files cannot be imported. Error is:

Cannot import xxxxx.reg: the script file is not a Registry script. Only binary archives of Registry can be imported via Registry Editor.

I open the file with Sublime Text 3 and found it is encoded with UTF-8 with BOM. I saved it with UTF-8 without BOM and all is fine.

It may has something to do with my OS locale: Spanish (Spain).

Changing colors for Ubuntu downloaded from Windows 10 Store

This works perfectly for older versions of Ubuntu on Windows, but I can't make it work for the new version (Ubuntu 18.04) that you download from the Windows 10 Store. When you right-click on the app in the start menu, it no longer gives you the option to "open file location". Is there a way to find the link to update for the new version? (Sorry in advance if this isn't the appropriate forum for this question.)

Flags for commands in powershell using DarkGray as foreground are unreadable

I just installed the solarized theme doing the registry add first, then updated the links, then copied the Set-SolarizedDarkColorDefaults.ps1 to my profile folder, and then added required text to the end of my profile. Everything looked great after running Out-Colors but once I started using it all of the flags for powershell commands are defaulting to the DarkGray for font color. This is making it unreadable for me. I looked in the Set-SolarizedDarkColorDefaults.ps1 but I do not see that being used except for background colors.

image

PS C:\WINDOWS\system32> git tfs clone $tfs $/IntraWebForms/AmexReporting --branches=all --workspace="c:\repos"

image

powershell.exe has default registry override for colours

Repeating #14 (comment):

There's a registry key in HKEY_CURRENT_USER\Console for %SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe which contains entries overriding the registry setting you've imported.

You can either delete/rename those keys (PopupColors, ScreenColors and anything starting with ColorTable), or update them to match the registry file you chose (solarized-dark.reg or solarized-light.reg).

There's also (on a 64-bit system) a %SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe key for the 32-bit powershell executable.

This shows up when the background and text colour of a powershell instance started by "Start->Run->powershell", i.e. not via a shortcut, is not affected by the registry file.

We probably need some way of addressing this, either in the documentation or with some kind of install script?

Can't figure out how to appy that to windows10 ubuntu bash

I don't know how to apply

" Copy the Set-Solarized*ColorDefaults.ps1 files to your profile directory, likely ~\Documents\WindowsPowerShell. Then add the following line of code to the end of your Microsoft.PowerShell_profile.ps1 or profile.ps1:"

to the windows 10 ubuntu bash, i tried to add that to the .bash_profile and .bashrc, but it can't recognize the line..

Powershell Dark screenshot unreproducible

Something's wrong with either the registry file or the screenshot.

It's pretty clear in the registry file (and the given command color 01) that "Black" (base03) should be the background colour.

However, the shown example has Black visible against the background, and "DarkGray" (base02) is invisible, suggesting that is set as the background colour.

I confirmed against http://ethanschoonover.com/solarized#usage-development that base03 should be the background colour, and base02 is for background highlight, so I suspect the screenshot is incorrect. It also doesn't match the equivalent result in mintty (e.g. https://github.com/mavnn/mintty-colors-solarized)

Setting the following in my profile.ps1 got me much closer to what I expected:

$Host.PrivateData.ErrorBackgroundColor = "DarkGray"
$Host.PrivateData.WarningBackgroundColor = "DarkGray"
$Host.PrivateData.DebugBackgroundColor = "DarkGray"
$Host.PrivateData.VerboseBackgroundColor = "DarkGray"

This is with Windows 10 anniversary edition.

I also noticed that I never get the solid colour blocks demonstrating background colours. I replaced the "`t" with eight spaces, I suspect tabs are see-through in newer PowerShell releases.

One more note, I had to add the following to my profile.ps1, as the default colouring for both Parameters and Operators was "DarkGray":

Set-PSReadlineOption -TokenKind Parameter -ForegroundColor DarkMagenta -BackgroundColor Black
Set-PSReadlineOption -TokenKind Operator -ForegroundColor DarkMagenta -BackgroundColor Black

I also just found https://www.reddit.com/r/PowerShell/comments/4aw3wa/solarized_powershell_console/ which gives Powershell script for updating the colours stored in console shortcuts.

Not work on Windows 1803

After upgrade from Windows 1709 to 1803, the Ubuntu bash reverted to the original colors. So I run Update-Link.cmd C:\Windows\System32\bash.exe light again.
But it gave me the following errors.

D:\code\other\cmd-colors-solarized>Update-Link.cmd  C:\Windows\System32\bash.exe light
New-Object : Exception calling ".ctor" with "1" argument(s): "Error HRESULT E_FAIL has been returned from a call to a COM component."
At D:\code\other\cmd-colors-solarized\Get-Link.ps1:501 char:4
+    New-Object Huddled.Interop.ShellLink (Convert-Path $Path)
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:14 char:1
+ $lnk.ConsoleColors[0]="#002b36"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:15 char:1
+ $lnk.ConsoleColors[8]="#073642"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:16 char:1
+ $lnk.ConsoleColors[2]="#586e75"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:17 char:1
+ $lnk.ConsoleColors[6]="#657b83"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:18 char:1
+ $lnk.ConsoleColors[1]="#839496"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:19 char:1
+ $lnk.ConsoleColors[3]="#93a1a1"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:20 char:1
+ $lnk.ConsoleColors[7]="#eee8d5"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:21 char:1
+ $lnk.ConsoleColors[15]="#fdf6e3"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:22 char:1
+ $lnk.ConsoleColors[14]="#b58900"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:23 char:1
+ $lnk.ConsoleColors[4]="#cb4b16"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:24 char:1
+ $lnk.ConsoleColors[12]="#dc322f"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:25 char:1
+ $lnk.ConsoleColors[13]="#d33682"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:26 char:1
+ $lnk.ConsoleColors[5]="#6c71c4"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:27 char:1
+ $lnk.ConsoleColors[9]="#268bd2"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:28 char:1
+ $lnk.ConsoleColors[11]="#2aa198"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:29 char:1
+ $lnk.ConsoleColors[10]="#859900"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

The property 'PopUpBackgroundColor' cannot be found on this object. Verify that the property exists and can be set.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:38 char:5
+     $lnk.PopUpBackgroundColor=0x0
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

The property 'PopUpTextColor' cannot be found on this object. Verify that the property exists and can be set.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:39 char:5
+     $lnk.PopUpTextColor=0x1
+     ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

The property 'ScreenBackgroundColor' cannot be found on this object. Verify that the property exists and can be set.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:40 char:5
+     $lnk.ScreenBackgroundColor=0xf
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

The property 'ScreenTextColor' cannot be found on this object. Verify that the property exists and can be set.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:41 char:5
+     $lnk.ScreenTextColor=0x6
+     ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At D:\code\other\cmd-colors-solarized\Update-Link.ps1:44 char:1
+ $lnk.Save()
+ ~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Updated C:\Windows\System32\bash.exe to Solarized - light

D:\code\other\cmd-colors-solarized>

Importing registry does not work for me.

I have tried adding the reg file as mentioned in the installation process. I dont see any changes in PowerShell or CommandPrompt after that.

Tried - Solarized Dark

Powershell arguments are coloured too dark

On a clean install of Windows 10 Creators Edition I've installed the solarized-dark theme.

Powershell changes the colour of typed commands based on their context (if they are parameters, for example).

For parameters (words starting with a - the colour used is too close to the background colour making them practically invisible:

Here's an example:

They typed command here is Set-PSReadlineOption -TokenKind parameter -ForegroundColor white, which happens to be a temporary fix

Neophyte here...

I get the following error when attempting to run this script. I'll be starting a degree in programming next year, so I'm basically clueless at this point about how to fix this. I was able to fix a previous error on line 151 by fixing a typo...
Capture

Command Update-link unknown

Hi,

Command Update-link is unknown with my PowerShell. Any idea ?
I got this error: " ObjectNotFound: (Update-Link:String) [], CommandNotFoundException".

Set ColorDefaults not working with latest powershell (v6)

I was trying to run the Set-SolarizedDarkColorDefaults.ps1, but it gave me an error:

The property 'CommandForegroundColor' cannot be found on this object. Verify that the property exists and can be set.

That is because Get-PSReadlineOption returns a different object now and colors are set in a different manner:

[...]
CommandColor                           : "$([char]0x1b)[93m"
CommentColor                           : "$([char]0x1b)[32m"
ContinuationPromptColor                : "$([char]0x1b)[34m"
DefaultTokenColor                      : "$([char]0x1b)[34m"
EmphasisColor                          : "$([char]0x1b)[96m"
ErrorColor                             : "$([char]0x1b)[91m"
KeywordColor                           : "$([char]0x1b)[92m"
MemberColor                            : "$([char]0x1b)[97m"
NumberColor                            : "$([char]0x1b)[97m"
OperatorColor                          : "$([char]0x1b)[90m"
ParameterColor                         : "$([char]0x1b)[90m"
SelectionColor                         : "$([char]0x1b)[30;44m"
StringColor                            : "$([char]0x1b)[36m"
TypeColor                              : "$([char]0x1b)[37m"
VariableColor                          : "$([char]0x1b)[92m"

The new way to set colors is described here: https://docs.microsoft.com/en-us/powershell/module/psreadline/set-psreadlineoption?view=powershell-6#examples

Arrow up / history broken on cmd

After applying the dark color scheme (including the registry update) when I open cmd and enter a command, then press the up arrow key, I only get a blank line and not the last command. If I open cmd via Win+R everything is working as it should, and the colors are still solarized (I guess for that case it uses the registry settings and not the updated shortcut .lnk). I reproduced this on two Windows 10 machines.
EDIT: On PowerShell this problem does not appear.

generalize to arbitrary color scheme

Not really an issue, but was wondering if there exists an easy way to generalize this to arbitrary color scheme.

Great work on this project, by the way!

Invisible letters

The DarkGrey color is so dark its hardly visible which makes life missarbale with a simple git commit -m "..." command as you cant even see the -m

Solarized Colors not working on powershell.

Hi,

I am using Windows 7, 32 bit. I did regedit /s solarized-dark.reg and got the beautiful colors in CMD.exe but my PowerShell (v 4.0) still remains the same. When I run the following code:

$Host.PrivateData.DebugBackgroundColor = "Black"
$Host.PrivateData.ErrorBackgroundColor = "Black"
function Out-Colors()
{
    [enum]::GetValues([ConsoleColor]) | % {
        Write-Host -NoNewLine "$($_.value__) : $_`t"
        Write-Host "COLOR`t" -ForegroundColor $_ -NoNewLine
        Write-Host "`t" -BackgroundColor $_
    }
}
Out-Colors

capture
This is what I got.

How can I make my powershell look like the one in your readme.md

Color mappings do not match Powershell Core ansi escape code mappings

It looks like the color mappings in this repo between powershell's colors and ansi color codes do not match those used by powershell's virtual terminal system.

For example, when Write-Host -ForegroundColor Magenta "test" is executed, powershell's virtual terminal emits ESC[35;1mtest (also known as brmagenta or High Intensity Magenta). The mapping in the readme file and code lists the mapping as: magenta -> magenta.

Below are the correct mappings in full:

termcol Powershell
black Black
red DarkRed
green DarkGreen
yellow DarkYellow
blue DarkBlue
magenta DarkMagenta
cyan DarkCyan
white DarkWhite
brblack DarkGray
brred Red
brgreen Green
bryellow Yellow
brblue Blue
brmagenta Magenta
brcyan Cyan
brwhite White

Shortcut colours

These are lovely colours for the command prompt.

However annoyingly (from Windows, nothing to do with these reg files) they don't get copied across to any shortcuts that you create to run the command prompt. I have a 'make me a sandwich' shortcut that opens the command prompt in admin mode.

I spotted that the command prompt registry keys are just child keys of the main Console key.

So for my shortcut that I named 'Make me a sandwich' you just have to edit the specified key in the
reg file to:

[HKEY_CURRENT_USER\Console\Make me a sandwich]

2014-10-29 15_52_28-make me a sandwich properties

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.