Using sixels in prompts (CMD, PowerShell, and Bash / WSL) #17876
PhMajerus
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
|
Maybe deserves a PR here after release to update https://www.arewesixelyet.com/ |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using sixels in prompts
This article shows how to embed sixels in string literals to include an image in the prompt in the Command Prompt (cmd.exe), Windows PowerShell (5.x), and PowerShell (6.x and later, pka PS Core).
Command Prompt (cmd.exe)
Here is a
as a prefix.
PROMPTcommand for cmd.exe to include the MS-DOS logoYou can create a batch file containing
@echo offon the first line and that command on the second line, and provide its path to the Command Processor in the registry atHKCU\Software\Microsoft\Command Processor\AutoRun(REG_SZorREG_EXPAND_SZ). This will make that command run automatically when launching cmd.exe.PowerShell
Here is a replacement
using Sixels.
promptfunction for PowerShell that replaces the textPSprefix with the modern (black) PowerShell logoOf course, you can include that line in your
$profilefile to do it automatically when launching PowerShell.Windows PowerShell
Here is the equivalent for the legacy (blue) Windows PowerShell logo
.
Bash (WSL)
Finally, here is how to embed a sixel logo in a Bash prompt, using the Ubuntu logo
.
This can be set in your
~/.bashrcfile to do it automatically when launching bash. For exemple by using the command lineecho "${PS1@A}" >> ~/.bashrcwhen you are satisfied with your current prompt.Note however that some features relying on Bash computing the width of the prompt will get slightly confused, such as the tab completion, and up/down history, when it believes the command has reached the end of the line.
Note all of these require a version of Windows Terminal that supports sixels. At the time of this writing, that means Windows Terminal Preview 1.22.2362.0, as the non-preview version is still on 1.20 which does not support sixels.
Beta Was this translation helpful? Give feedback.
All reactions