Last active
December 24, 2022 00:48
Revisions
-
cptpiepmatz revised this gist
Dec 24, 2022 . 1 changed file with 9 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,13 +16,16 @@ function ExitCode { } function OnBranch { Try { $consoleOut = $((git branch) -match "^\*\s+(?<Branch>\S+)"); if ($consoleOut) { if ($consoleOut -ne "True") { $consoleOut = ($consoleOut -match "^\*\s+(?<Branch>\S+)"); } return " on " + "$ESC[38;5;163m" + $Matches.Branch + "$ESC[0m"; } } Catch {} return ""; } @@ -71,4 +74,4 @@ function global:prompt { (ViaRust) + "`n" + "> " } -
cptpiepmatz revised this gist
Oct 7, 2022 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,15 @@ switch ($env:ComputerName) { default {$computerName = $env:ComputerName} } function ExitCode { if (-not($?)) { if ($LASTEXITCODE -ne 0) { return " {" + $LASTEXITCODE + "}"; } } return ""; } function OnBranch { $consoleOut = $((git branch) -match "^\*\s+(?<Branch>\S+)"); if ($consoleOut) { @@ -44,7 +53,10 @@ function ViaRust { } function global:prompt { "PS" + "$ESC[38;5;1m" + (ExitCode) + " " + "$ESC[38;5;33m" + $env:UserName + "@" + -
cptpiepmatz revised this gist
Mar 24, 2022 . 1 changed file with 41 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,43 @@ switch ($env:ComputerName) { default {$computerName = $env:ComputerName} } function OnBranch { $consoleOut = $((git branch) -match "^\*\s+(?<Branch>\S+)"); if ($consoleOut) { if ($consoleOut -ne "True") { $consoleOut = ($consoleOut -match "^\*\s+(?<Branch>\S+)"); } return " on " + "$ESC[38;5;163m" + $Matches.Branch + "$ESC[0m"; } return ""; } function ViaNode { Try { if (Get-Item -Path "package.json") { $nodeVersion = $(node -v); return " via $ESC[38;5;2mNode " + $nodeVersion + "$ESC[0m"; } return ""; } Catch { return ""; } } function ViaRust { Try { if (Get-Item -Path "Cargo.toml") { $rustVersion = $((rustc -V) -match "rustc (?<Version>\S+)"); return " via $ESC[38;5;166mRust " + $Matches.Version + "$ESC[0m"; } return ""; } Catch { return ""; } } function global:prompt { "PS " + "$ESC[38;5;33m" + @@ -17,5 +54,9 @@ function global:prompt { "$ESC[38;5;214m" + ("$pwd").Replace("$home", "~") + "$ESC[0m" + (OnBranch) + (ViaNode) + (ViaRust) + "`n" + "> " } -
Piepmatz revised this gist
Jun 20, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,7 @@ function global:prompt { $env:UserName + "@" + $computerName + "$ESC[0m" + ":" + "$ESC[38;5;214m" + ("$pwd").Replace("$home", "~") + -
Piepmatz revised this gist
Jun 20, 2020 . No changes.There are no files selected for viewing
-
Piepmatz created this gist
Jun 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ $ESC = [char]27 switch ($env:ComputerName) { "TIMSYOGA" {$computerName = "TY"} "TIMSTOWER" {$computerName = "TT"} default {$computerName = $env:ComputerName} } function global:prompt { "PS " + "$ESC[38;5;33m" + $env:UserName + "@" + $computerName + ":" + "$ESC[38;5;214m" + ("$pwd").Replace("$home", "~") + "$ESC[0m" + "> " }