gardebring / powercolorls Goto Github PK
View Code? Open in Web Editor NEWPowerShell script to display a colorized directory and file listing with icons
License: MIT License
PowerShell script to display a colorized directory and file listing with icons
License: MIT License
The tree.com
Windows command is extremely old and very limited. It'd be nice to have a flag for showing tree-like output, something like jit-tree does.
Which font at Nerd Fonts do I install? There are dozens.
Hi! 😃
For some reason, in some cases, icons in folders are not displayed.
I am using PowerColorLS version 1.0.2 and terminal-icons version 0.5.1
I'm using PowerShell 7.2.0-preview.6
Here is my powershell profile file with the settings:
# $global:DefaultUser = [System.Environment]::UserName
$env:POSH_SESSION_DEFAULT_USER = [System.Environment]::UserName
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme ~/.oh-my-posh.omp.json
Import-Module PSReadLine
Import-Module Terminal-Icons
Import-Module PowerColorLS
# Shows navigable menu of all options when hitting Tab
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
# Autocompleteion for Arrow keys
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineOption -ShowToolTips
Set-PSReadLineOption -PredictionSource History
#Set the color for Prediction (auto-suggestion)
Set-PSReadlineOption -Colors @{Prediction = "#0bda51" }
Set-PSReadLineOption -Colors @{
Command = '#00ff00'
Number = '#0ee7ff'
Member = '#ffff00'
Operator = '#08e8de'
Type = '#c72fff'
Variable = '#c0ff2f'
Parameter = '#fde910'
ContinuationPrompt = 'DarkGray'
Default = '#30d5c8'
}
# Import-Module Get-ChildItemColor
function PowerColorLSWithParams([string] $query = ".") {
PowerColorLS $query -l -ds -sd -a
}
Set-Alias -Name ls -Value PowerColorLSWithParams -Option AllScope
Set-Alias -Name which -Value Get-Command
# If (-Not (Test-Path Variable:PSise)) {
# # Only run this in the console and not in the ISE
# Import-Module Get-ChildItemColor
# Set-Alias l Get-ChildItem -option AllScope
# Set-Alias ls Get-ChildItemColorFormatWide -option AllScope
# }
# Import-Module PoshColor
Import-Module z
When used on Linux directories are shown with a '\' postfix rather than the more acceptable '/' suffix.
I noticed it's showing ~2x the size of a particular folder when compared to the Explorer's Properties dialog. Upon inspecting, I found out that the folder contained symlinks to some other folders.
The --show-directory-sizes
flag should ideally ignore symlinked (soft linked) folders and should not recurse into them to add their size to the output.
Script I used for testing:
mkdir test_folder
echo "some test text" >> test_file.txt
cd test_folder
New-Item -Name the_link -ItemType SymbolicLink -Value ../test_file.txt
PowerColorLS
Get-ChildItem
Calling PowerColorLS
doesn't output anything:
Using:
I get this terrible and unreadable long date format for the listing PowerColorLS -hi -sd -a -l
.
This makes things impossible to read on long listings. Please consider making it a normal data string: YYYY-MM-DD HH-MM-ss
.
Hello,
I like the colorized output, but don't have a nerd font or don't necessarily want to create my own patched font. As a result, I was wondering if there was an option to disable the terminal icons and still use your package?
Thanks
Hi!
It's so nice that PowerColorLS provides so many flags for output. Is it possible to have a flag to display the items with colors but without icons? Some terminals don't have icon support and I currently use https://github.com/JRJurman/PowerLS to have unix-like ls there.
It'd be great if I just install one module instead of two.
Thanks!
Hi!
Thank you for your wonderful script!
Please tell me how to configure alias for the PowerColorLS command with options:
-l -ds -sd -a?
In other words, I want the command "ls" to be a replacement for such a command:
ls -l -ds -sd -a
I have tried to investigate this issue and the only thing I have understood is that there is no way to pass the parameters of the cmdlet into the alias. To execute an alias with parameters, you need to use a function to do this.
But I don't understand how to write such a function for my case, because I'm completely unfamiliar with the language Powershell.
Help me, please.
The script fails at line 119 char 30, which is $gitGlyph = $glyphs["nf-fa-check"]
I DID install Terminal-Icons and it WORKS pretty fine
Import-Module : 所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:119 字
符: 30
+ $gitGlyph = $glyphs["nf-fa-check"]
+ ~~~~~~~~~~~~~
表达式或语句中包含意外的标记“nf-fa-check"]
}
$gitColor = (ConvertFrom-RGBColor -RGB ("00FF00"))
foreach($gitStatusItem in $gitInfo.gitStatusItems){
$updateGitStatus = $false
$currentItemForGitCompare = $fileSystemInfo.FullName -Replace "\\", "/"
if($currentItemForGitCompare -eq $gitStatusItem.path){
$updateGitStatus = $true
}elseif($isFolder -and ($gitStatusItem.path.StartsWith($currentItemForGitCompare,'CurrentCultureIgnoreCase'))){
$updateGitStatus = $true
}
if($updateGitStatus){
switch($gitStatusItem.status){
"??" {
if($hideIcons){
$gitGlyph = "?";
}else{
$gitGlyph = $glyphs["nf-fa-question"]
}
$gitColor = (ConvertFrom-RGBColor -RGB ("FF0000"))
}
default{
$gitGlyph = $gitStatusItem.status
$gitColor = (ConvertFrom-RGBColor -RGB ("FFFF00"))
}
}
}
}
$gitColorAndIcon = "${gitColor}${gitGlyph}”。
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:149 字符: 48
+ $gitColorAndIcon = "${gitColor}${gitGlyph} "
+ ~
字符串缺少终止符: "。
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:116 字符: 19
+ if($hideIcons){
+ ~
语句块或类型定义中缺少右“}”。
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:97 字符: 29
+ function Get-GitColorAndIcon{
+ ~
语句块或类型定义中缺少右“}”。
所在位置 行:1 字符: 1
+ Import-Module PowerColorLS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Import-Module], ParseException
+ FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.ImportModuleCommand
Updated As mentioned in Pull Request #15 , change encoding of GitFunctions.ps1
from UTF-8 to GBK/GB2312 (system's default encoding)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.