#Reset Prompt after 1 second & Right Prompt

808 messages ยท Page 1 of 1 (latest)

rancid wadi
#

Hi, so I have been using powershell for sometime now it's great although I am completely new to world of coding etc but what I want to say is that Um I want to reset my starship prompt after every one second like on zsh with the script

`TMOUT=1

Trapalrm(){
Zle reset-prompt
}`

So if anyone does know how to do this pls help ๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

olive magnet
#

you want to ... reset your prompt?

#

like ... redraw it?

#

I think for that you need to mess with the readline

#

I mean, I'm reasonably sure that running something on a timer while you're sitting at the prompt can only be done by the readline -- because that's the only thing that's running when you're sitting at a prompt.

rancid wadi
#

ok

#

but like on zsh

#

it works not sure about powershell

#

I mean basically my goal is to reset the prompt after 1 second cuz I set time there but the contents I am typing shouldnt be removed only the prompt

olive magnet
#

That's because zsh does a lot more work for prompts than any other shell. Not only does it have a refresh, it also has right-aligned prompts, etc.

olive magnet
#

oh, wait ...

#

I know how to do this

#

lol

#

There's a Powershell "OnIdle" event

olive magnet
#

PSReadLine stops emitting the OnIdle once you type something though, so the prompt refreshing will stop at that point.

olive magnet
#

If you have a one-line prompt, it's enough to do:

Register-EngineEvent -SourceIdentifier PowerShell.OnIdle { Write-Host "`e[0G$(prompt)" -NoNewline }
near pebble
olive magnet
#

That ... doesn't seem worth it.

near pebble
olive magnet
#

I mean, I think it's there because you can do it even after you started typing...
but Write-Host "``e[0G$(prompt)" -NoNewline doesn't really need an abstraction.

#

I guess if your prompt is only sometimes multi-line ....

#

No, I don't know if they handle that or not

near pebble
#

Oh I see what you mean. I do like the time ticking away.

olive magnet
#

Yeah, I think I'm going to add a switch to Powerline to do that automatically

rancid wadi
#

well sorry to dissapoint but mine is 2 line prompt

#

my prompt setup using starship

#

so if it has like 2 lines then does on idle work?

#

@olive magnet

#

sorry for the ping

#

i can ping right?

olive magnet
#

if you have two lines you need "`e[2A"

rancid wadi
#

whats that

#

just so you know i am a noob in powershell

olive magnet
#

`e[ n A

#

Is the escape sequence for "go up n lines"

rancid wadi
#

ok

#

giving the code directly helps

#

๐Ÿ™‚

#

sorry for the trouble

olive magnet
#

`e[0G # means go to column zero

rancid wadi
#

ok

olive magnet
#

So this line:
Write-Host "``e[0G$(Write-PowerLinePrompt)" -NoNewline

rancid wadi
#

Register-EngineEvent -SourceIdentifier PowerShell.OnIdle { Write-Host "`e[0G$(prompt)" -NoNewline }

#

this write?

olive magnet
#

If you have a two line prompt, then you make it:
Write-Host "``e[2A``e[0G$(Write-PowerLinePrompt)" -NoNewline

rancid wadi
#

ohhh

#

thanks i can just paste it in profile.ps1 right?

olive magnet
#

yeah, I mean ... check that it works by running it first ๐Ÿ˜‰

#

The only thing is .... starship is slow

rancid wadi
#

๐Ÿ™‚

olive magnet
#

So I don't know if it can keep up with running every 300ms ๐Ÿ˜‰

rancid wadi
#

well i mean to my experience its great but lets see

#

๐Ÿ™‚

olive magnet
#

๐Ÿ™‚

rancid wadi
#

well it dont work

#

so i dont get it

#

also right prompt isnt supported right?

olive magnet
#

Yeah, there's no rightprompt in PSReadLine, only ZLE does that, as far as I know

rancid wadi
#

ok

#

so it doesnt seem to work

#

or i might have made an error or let me just send my gist

olive magnet
#

If you press Ctrl+L over and over ... does that update the time?

rancid wadi
#

yeah

#

its just create new line right?

olive magnet
#

oh, ...

#

sorry, I see you copied TWO backticks

#

it should be `e[

rancid wadi
#

ohhhh

olive magnet
#

not ``e[

rancid wadi
#

ok

#

lets see

olive magnet
#

Still though ... that's weird.

rancid wadi
#

what about 2A``?

olive magnet
#
Write-Host "`e[2A`e[0G$(Write-PowerLinePrompt)" -NoNewline
#

err, but not Write-PowerLinePrompt

#

You need to call starship

rancid wadi
#

oh

#

so starship prompt?

#

debugging is hard

#

XD

#

wait how do i call

olive magnet
#
Write-Host "`e[2A`e[0G$(prompt)" -NoNewline
rancid wadi
#

this line Invoke-Expression (&starship init powershell)

olive magnet
#

not init, you'd have to look at what starship puts in your prompt

#

I forget ๐Ÿ˜‰

rancid wadi
#

o

olive magnet
#

I tried starship and ohmyposh, but they are both slow (like, visibly delayed, if you just hold down Enter).

#

But you can probably just call prompt

#

because that's what PowerShell calls when it wants the prompt

rancid wadi
#

so &starship

#

yeah it doesnt work

olive magnet
#

Is that your profile?

rancid wadi
#

yeah

olive magnet
#

what does starship init powershell output

rancid wadi
#

the prompt

#

starship prompt

olive magnet
#

no. Deffinitely not.

rancid wadi
#

well if i comment it starship dont work

olive magnet
#

ALLLLL of that.

rancid wadi
#

ok

#

....

#

i didnt know that

olive magnet
#

try calling:

starship prompt --path=$($cwd.Path) --logical-path=$($cwd.LogicalPath) --terminal-width=$($Host.UI.RawUI.WindowSize.Width) --jobs=$($jobs)
rancid wadi
#

in () write?

olive magnet
#

If you run that in your terminal, do you get an extra prompt output?

rancid wadi
#

error

#

well does my powershell have problem

olive magnet
#

use $pwd instead of $cwd

rancid wadi
#

i am using preview powershell

#

error too

olive magnet
#

Oh good grief.

#

They have made a weird custom Get-Location

rancid wadi
#

....

#

i guess i am troubling you very much

olive magnet
#

so, if you just run: prompt does it draw?

rancid wadi
#

well i get a cross

olive magnet
#

so like, if you do:

prompt; start-sleep 1; prompt
rancid wadi
#

it keeps printing new lines

olive magnet
#

cool

#

what if you do ...

#
$one = prompt; start-sleep 1; $two = prompt
rancid wadi
olive magnet
#

ok, so it seems like the thing I gave you before should work ....

#
Register-EngineEvent -SourceIdentifier PowerShell.OnIdle { Write-Host "`e[2A`e[0G$(prompt)" -NoNewline }
rancid wadi
#

yeah but it will keep creating new lines i mean like i want it to redraw it

olive magnet
#

is that making extra lines?

#

maybe their prompt outputs an extra line at the top, and you need 3A

rancid wadi
#

nice

olive magnet
#

That's weird, is it going ... up?

rancid wadi
#

yes

olive magnet
#

lol

rancid wadi
#

but on idle time updates

olive magnet
#

try `e[1A

rancid wadi
#

surprising

olive magnet
#

oh, and ...

#

clean out the old ones with ...

rancid wadi
#

both of the two lines update

olive magnet
#

Get-EventSubscriber | Unregister-Event

rancid wadi
olive magnet
#

Are you using white on white on purpose? lol

rancid wadi
#

lol

#

no

#

sorry notebad was on background

olive magnet
#

lol, I get it. I actually gave up on the cool looking terminal because of that ๐Ÿ˜‰

#

I mean, gave up using transparency on it

rancid wadi
#

ohh

olive magnet
#

ok, so is it still going upward?

rancid wadi
#

no its stuck there

#

but it updates both at the same time tough

olive magnet
#

right but if you ... run ls or something

rancid wadi
olive magnet
#

So it's staying there, but doubling up the prompt?!?

rancid wadi
#

yeah

#

i was like surprised lol

olive magnet
#

Weird!

rancid wadi
#

but both lines do update which is weirder

olive magnet
#

heh

#

Yeah.

#

Get-EventSubscriber | Unregister-Event

#

Run that

#

or just run the Get

#

I think you must have two versions set

rancid wadi
#

get what

olive magnet
#

Get-EventSubscriber

#

See if there's more than one

rancid wadi
#

no

olive magnet
#

And you have it set to 1A?

rancid wadi
#

yeah

#

no wait after unregistering

#

and reregistering it works

olive magnet
#

lol

rancid wadi
#

weird

#

lol

olive magnet
#

whew

rancid wadi
#

XD

#

you are a life saver thanks

olive magnet
#

no problem

rancid wadi
#

i guess debugging is fun

olive magnet
#

I'm totally going to build this into my prompt module ๐Ÿ˜‰

rancid wadi
#

sorry for the trouble caused

#

๐Ÿ™‚

#

np

#

feel free to do so

#

we can share jist sometimes

#

also how did you set up your prompt?

rancid wadi
#

although on zsh it updates even when content is written but i aint complaining glad it works

rancid wadi
#

I like customizing more

#

XD

#

also are there study materials for powershell?

#

cuz i really got interested now

olive magnet
#

My current prompt is:

Set-PowerLinePrompt -SetCurrentDirectory -PowerLineFont -Title {
    -join @(
        if (Test-Elevation) { "Administrator: " }
        if ($IsCoreCLR) { "pwsh - " } else { "Windows PowerShell - " }
        Convert-Path $pwd
    )
} -Prompt @(
    New-TerminalBlock -Content { Update-ZLocation $pwd }
    Show-ElapsedTime -Autoformat -Prefix "&hourglassdone;" -Bg DeepSkyBlue -Fg Black -Caps '๎ƒ…', '๎ƒ„'
    New-TerminalBlock -NewLine
    New-TerminalBlock -NewLine

    Show-NestedPromptLevel -BackgroundColor Magenta1 -RepeatCharacter "&gear;" -Postfix " "
    Show-HistoryId -Bg Magenta4 -Fg White
    New-TerminalBlock -Spacer

    Show-KubeContext -Bg DarkOrchid2 -Fg White
    Show-AzureContext -Bg Purple3 -Prefix "&nf-mdi-azure; " -Fg White
    Show-Path -HomeString "&House;" -Separator '๎‚น' -Bg SlateBlue4 -Fg White -Depth 3
    New-TerminalBlock -Spacer

    Show-PoshGitStatus -Bg Gray30
    New-TerminalBlock -NewLine
    Show-Date -Format "h\:mm\:ss" -Bg DeepSkyBlue4 -Fg White
)
#

oh, except I just adjusted it for that redraw ๐Ÿ˜‰

rancid wadi
#

lol

#

well i have no problem with that cuz I love open source

rancid wadi
#

well lets be friends

#

also i cant seem to find any resources on powershell

olive magnet
#

use that to measure how fast your prompt runs ๐Ÿ˜‰

#

Measure-CommandEx { prompt } -Iterations 100

#

So, there's a bunch of resources linked in #resources

rancid wadi
#

but adding the redraw to Powershell should help others right? if someone is like me

olive magnet
#

:-p

rancid wadi
#

ok

#

๐Ÿ™‚

#

but how do i use messure command

olive magnet
#

you know ... more and more of these "embeds" are useless

olive magnet
#

(the link previews, I mean)

rancid wadi
#

yeah cuz you just read the link

olive magnet
#

and like the fostodon one is like ... "here's what fosstodon is" ... instead of a preview of the actual post

rancid wadi
olive magnet
#

and run that (either paste the script in your terminal, or in your profile, or save it ... and "dot source" it) to define the function

#

I really need to get those new branches of TerminalBlocks and PowerLine published

#

sigh

#

not enough hours in the day

rancid wadi
#

lol

#

being mod is hard

#

2 prompts in 1 second

#

pretty fast i guess

#

but it malfucntioned

olive magnet
rancid wadi
#

so many events why

SubscriptionId : 6
SourceObject :
EventName :
SourceIdentifier : PowerShell.OnIdle
Action : System.Management.Automation.PSEventJob
HandlerDelegate :
SupportEvent : False
ForwardEvent : False

SubscriptionId : 5
SourceObject :
EventName :
SourceIdentifier : PowerShell.OnIdle
Action : System.Management.Automation.PSEventJob
HandlerDelegate :
SupportEvent : False
ForwardEvent : False

SubscriptionId : 4
SourceObject :
EventName :
SourceIdentifier : PowerShell.OnIdle
Action : System.Management.Automation.PSEventJob
HandlerDelegate :
SupportEvent : False
ForwardEvent : False

SubscriptionId : 7
SourceObject :
EventName :
SourceIdentifier : PowerShell.OnIdle
Action : System.Management.Automation.PSEventJob
HandlerDelegate :
SupportEvent : False
ForwardEvent : False

#

nice

#

so i dont get whats wrong

olive magnet
#

You must have put the register-engineevent into your prompt?

rancid wadi
#

yeah

olive magnet
#

you need it in your profile.ps1 but not inside the prompt

#

I mean, it needs to run once, and only once

rancid wadi
#

i did it once

#

its on .ps1

#

other than that none

#

so every time i refresh it creates new events

#

....

#

also messure command will i just copy all of them on profile.ps1 or anyother way

#

@olive magnet

olive magnet
#

why are you refreshing?

#

I mean, if you want to be able to refresh, you're going to need something like ....

rancid wadi
#

nope when i ceate new powershell tabs

#

it refreshes right?

olive magnet
#

a new tab gets a new session

rancid wadi
#

yes

olive magnet
#

That should not re-run the profile though

#

I mean, it runs it ... once ... in the new session

rancid wadi
#

it does though

#

yeah on the new session

#

i mean i was tryig to set up the ex command

#

....

#

like i said i am a complete noob when it comes to coding

olive magnet
#

can you show where you added it in profile.ps1?

rancid wadi
olive magnet
#

Hmm. and is anything re-running your profile.ps1?

rancid wadi
#

nope

#

to fix the issue i unregister it

#

then register it by .$profile

#

well problem started when i tired to use the messure ex command

olive magnet
#

but didn't you just measure prompt ?

rancid wadi
rancid wadi
rancid wadi
#

but then problems start

olive magnet
#

oh, and then sourced your profile?

rancid wadi
#

yeah

olive magnet
#

So yeah, anyway, just do:
Get-EventSubscriber -SourceIdentifier PowerShell.OnIdle -ErrorAction Ignore | Unregister-Event

#

Before you Register it

#

To make sure you're not doubling up

rancid wadi
#

well will i register now

#

nope same problem

#

it still got doubled

#

TT-TT

#

why

#

(โ•ฏยฐโ–กยฐ)โ•ฏ๏ธต โ”ปโ”โ”ป

#

well i removed the messure script but it still not fixed

olive magnet
#

When you look at the subscribers, what do you see?
Get-EventSubscriber -SourceIdentifier PowerShell.OnIdle
or ...
Get-EventSubscriber -SourceIdentifier PowerShell.OnIdle | % Action
or ...
Get-EventSubscriber -SourceIdentifier PowerShell.OnIdle | % Action | % Command

rancid wadi
olive magnet
#

Oooh, you said repeats, and I misunderstood

rancid wadi
#

lol

olive magnet
#

It's redrawing the prompt, but one line lower every tick?

rancid wadi
#

yeah

#

but is yours ok

olive magnet
#

It seems like you need to try going back to 2A?

rancid wadi
#

ok

olive magnet
#

Yeah, but I'm ... counting lines ๐Ÿ˜‰

rancid wadi
#

lol

#

now its ok

#

welp

#

so how do i use the messure script

#

cuz it created errors here

olive magnet
#

I don't think that's what caused errors ๐Ÿ˜‰

#

But what I do, is save it in my PowerShell/Scripts folder (which is on my PATH)

#

and then I have to run . Measure-CommandEx.ps1 to load it when I want to use it

#

Or, you can comment out the function line and the last } line, and make it usable as a script file

rancid wadi
#

oh

#

let me see

#

or you can just send a screen shot

#

cuz a picture is worth a 1000 words

#

๐Ÿ˜‰

#

also i dont think mine will run very cuz

#

i am using an intel celeron cpu

#

with 4 gb ram

#

i am bascially no competition

#

-_("")/-

#

and my laptop overheats all the time

olive magnet
rancid wadi
#

so i use it when i am brewing coffe

olive magnet
#

lol

rancid wadi
#

lol

olive magnet
#

I'm sorry ๐Ÿ˜„

rancid wadi
#

np

#

i dont really mind

#

cuz its the truth

olive magnet
#

Anyway, the whole point of Measure-CommandEx isn't to compare against each other

#

It's to compare two different options on your own computer ๐Ÿ˜‰

#

So e.g. to compare starship to ohmyposh to powerline ๐Ÿ˜‰

rancid wadi
#

oh

#

i didnt mean like that

#

i just meant that i had no hope

#

but let me try

#

so i will create a file on my home

#

then run that file right?

#

also i am its_19818942118 on github

#

๐Ÿ™‚

olive magnet
rancid wadi
#

ok

olive magnet
#

I took off the seconds, because I just find them distracting, but I think I'm going to leave the refresh on there, because it means the prompt will relatively accurately show the time the command was run...

rancid wadi
#

how to create file in powershell again?

#

oh wait let me just use nvim

olive magnet
#

I was just using a double chevron like:

rancid wadi
#

ok

olive magnet
#

(with the time on the previous line)

#

shrugs

rancid wadi
#

also if file then sp1?

#

*ps1

olive magnet
#

.ps1

#

yeah

#

you should be able to run .ps1 scripts

#

by their base name

#

(i.e. without typing the .ps1) if they are in your PATH

#

or by relative path, like ./Measure-CommandEx.ps1 or just ./Measure-CommandEx

#

But I'm going to head to bed.

#

Because it's nearing 2am, and I have to work in 8 hours :-p

rancid wadi
#

ohhh

#

sorry to keep you up

#

but do sure text me

#

i will send you the results

#

๐Ÿ™‚

#

or in here

#

good night

near pebble
#

wow! y'all really went at it!

#

I was thinking invokeprompt would work better because it would redraw . I assumed calling prompt would just double it up

#

with oh-my-posh

Register-EngineEvent -SourceIdentifier PowerShell.OnIdle { Write-Host "`e[0G$(prompt)" -NoNewline }

does work.

#

i have a one line prompt though.

#

That is super cool.

olive magnet
#

I built the feature into PowerLine -- now I just have to release it ๐Ÿ˜‰

near pebble
#

Yeah I am pretty commited to oh my posh even though it is slower.

#

For some reason I get an extra space when I come out of idle. And I have to backspace.

rancid wadi
#

LoL

#

He stayed awake at 2pm just to help with this project

#

Well you can say it's a project right

rancid wadi
#

I will tryout power line once

#

Also it outputs the command running

#

So if I remove sourcefinder then it should work right?

#

Also another cool feature would be like redraw but right prompt

#

Cuz we although I didn't contribute at all but right prompt would be cool right and power line is fast so writing out a right prompt script helps improve it further

#

Although I regret it cuz I can't seem to find ways to use right prompt

#

With starship

rancid wadi
olive magnet
#

The old PowerLine release (the current version, actually) supports right prompt, but it does not do it well, so I'm taking that feature out in the release I'm working on now.

rancid wadi
#

Yeah ๐Ÿ‘

#

But to be honest though

#

I think power line and all that are very cluttered prompt

#

I would have used power line and all that

#

Well I first used ohmyposh but it was kind of not very workflow friendly and very distracting

#

But starship is customizable like keeping it simple but asthetic

#

๐Ÿ˜‰

#

@olive magnet I have a question

#

Just can't get rid of the event id string

tidal latch
#

I'll definitely try this working when I get a chance. I'm a starship user and would love to add current time in the second line of my prompt.

olive magnet
#

PowerLine is waaay more customizable than starship or ohmyposh ๐Ÿ˜›

tidal latch
#

PowerShell only?

tidal latch
#

TIL they made powerline in go.

#

Ironically I make my starship look like powerline.

olive magnet
#

my module is powerShell only, yes

#

Why would anyone want to use a different shell? ๐Ÿ˜‰

#

But honestly -- prompts that run native in the language of the shell are faster

tidal latch
#

I'll check it out when I get a chance

rancid wadi
#

i guess i should move to linux cuz windows is strugling with my crap hardware

#

i cant even have a decent zoom experience

rancid wadi
#

also i am sorry for replying so late cuz by the time you all text its currently 11 (24h) lol i usually wake up ate 10 but currenly sick

#

๐Ÿ™‚

rancid wadi
#

also the event id string is so annoying

#

it ruins my configs

#

also how do install powershell preview in linux using package manager like on ubuntu and debian based system

near pebble
rancid wadi
#

Nix as in the nix os?

tidal latch
#

We need a prompt channel @olive magnet . I just wanna nerd out on escape codes ๐Ÿค“๐Ÿคฃ

olive magnet
rancid wadi
#

Oh thanks

#

And where do I place it?

#

In source identifier or around brackets

#

Reset Prompt after 1 second & Right Prompt

olive magnet
#

$null = Register-EngineEvent ...

rancid wadi
#

Oh

#

Ok

near pebble
# rancid wadi Nix as in the nix os?

When I say *nix , the askerisk bascially stands in for like. So I mean all of Unix and Linux flavors and off shoots there abouts. It is a shorthand to talk about the fuller scope of those types of operating systems and the operating systems that flow from and will flow to.

rancid wadi
#

Oh now I know what the Unix reddit nix config meant

#

Pretty new to the dev world

#

Well like started here 1 week trying best to learn

tidal latch
#

@rancid wadi I see that Jaykul's original event register works in Pwsh but not in PS5 (at least for starship)

#

That's likely because it doesn't support `e as the escape code.

#

Register-EngineEvent -SourceIdentifier PowerShell.OnIdle { Write-Host "$([char]27)[2A$([char]27)[0G$(prompt)" -NoNewline } works on Windows PowerShell.

olive magnet
#

@tidal latch are you using the latest PSReadLine on PS5?

#

oh, yeah, `e

#

hah

tidal latch
#

I'm probably not.

olive magnet
#

No, you're right about the `e = $e = $([char]27)

#

That would stop it working in 5

tidal latch
#

Also in starship there's the concept of a transient prompt. I'm probably going this route since I can tweak what previous prompts look like (and get accurate timestamps). https://starship.rs/advanced-config/#transientprompt-in-powershell

tidal latch
#

Also, TIL that starship supports prompt profiles. Which means you can have it print a "short profile"

#

takes note for future blog post

rancid wadi
#

Oh

#

Works

#

Will check it out

#

Also I found a way to have right prompt

#

Also will the above code work?

#

I am confused about both code look about the same so it would be better to tell me which one

rancid wadi
rancid wadi
tidal latch
#

So profile aren't really documented. But I'll be putting up a blog post about it soon.

rancid wadi
#

ok

#

i caught up to you cuz i seem to miss all the others often

rancid wadi
#

right prompt done

tidal latch
#

I'll grab my laptop in a bit and share the code

#

If you want the full prompt, you can set the transiant prompt to print starship prompt or just prompt

tidal latch
#

Add something like this to your prompt if you wanna make a different profile. This one makes a profile called short.

[profiles]
short = """
[\uE0B6](fg:purple)[$directory](bg:purple)\
[\uE0B0](fg:purple bg:12)$time\
[\uE0B0](fg:12 bg:none) $character
"""
#

Then you can tell the transient prompt to call it with:

function Invoke-Starship-TransientFunction {
    &starship prompt --profile short
  }
Enable-TransientPrompt
tidal latch
olive magnet
#

In PowerLine, just output a "`t" ๐Ÿ˜‰

rancid wadi
#
format = """
[โ•ญโ•ด](bold purple)$os \
| $username\
$directory $fill $shell๎‚ณ \
$git_branch\
$git_status\
$lua\
$terraform\
$vagrant\
$docker_context\
$helm\
$python\
$nodejs\
$ruby\
$kubernetes\
$kubernetes
[โ•ฐโ”€](bold red)$character
"""
# Right_format

right_format = """
$battery\
$time\
$cmd_duration
"""

$fill module does the trick

#

pretty asthetic ๐Ÿ™‚

#

๐Ÿ˜‰

olive magnet
#

as long as your commandline doesn't reach the right side ๐Ÿ˜›

rancid wadi
#

true

#

and as zsh supports right prompt it makes it even easier

#

can be done on powershell too

olive magnet
#

Yeah, zsh does it in the readline though

#

So they can clear the rightprompt when they need the space

rancid wadi
#

yeah

#

it doesnt affect much like its efficien in my opinion

olive magnet
#

Yeah, I generally just settle for having a status line and then a tiny prompt.

rancid wadi
#

yeah at first i did too

#

but wanted to try out more will i guess it cluttered but not much in my opinion XD

olive magnet
#

Sometimes, a trailer, like:

rancid wadi
#

your ls is plain

#

use terminal icons

olive magnet
#

lol

tidal latch
#

It's not the size of the prompt. It's about how you automate your commands.

olive magnet
#

Happy?

rancid wadi
#

yeah lol

olive magnet
#

I don't load it all the time, because it takes half a second to load

rancid wadi
#

but its different though which one did you use?

olive magnet
#

I themed it

rancid wadi
rancid wadi
olive magnet
#

TerminalIcons makes me sad, because this does not work:

$Theme = Get-TerminalIconsTheme 
<# edit #>

$Theme | Set-TerminalIconsTheme
rancid wadi
#

wht does it do ?

#

i didnt experiment with it

olive magnet
#

it can't bind the pipeline

rancid wadi
#

oh

#

by the way i didnt know it would actually work but if you

clear | $PROFILE

it actually makes it look like you opened a fresh new tab

#

i guess you would know right?

olive magnet
#

Ctlr+L

rancid wadi
#

ctrl just um creates new line though

olive magnet
#

it scrolls it to clear the screen

#

without loosing your buffer

rancid wadi
#

no what i mean is that it clears the screen and draws the profile like when you open a new tab ๐Ÿ™‚

olive magnet
#

Yeah, except that in PowerShell, re-running your profile doesn't reset everything

#

Because we have a ton more "state" than just environment variables

rancid wadi
#

like i was experimenting with pipelining but zsh just dies when i apply this

rancid wadi
olive magnet
#

shrug it's also more powerfull

#

๐Ÿ˜‰

rancid wadi
#

๐Ÿ˜‰

#

but to be honest i was really surprised like most shells dont support transient promt but powershell does so i was surprised its so powerful i didnt know that cuz it requires complex scripting like on zsh where transient prompt might segfault zsh TT_TT

#

also i cant seem to install powershell preview from debian repo TT_TT

#

pls help

rancid wadi
rancid wadi
tidal latch
#

Starship.toml

rancid wadi
#

oh basically on my config

tidal latch
#

Make sure you have a recent version if its not working.

rancid wadi
#

well i am on the latest version

#

if i try others config it works but my config deoesnt seem to

tidal latch
rancid wadi
#

isnt pwsh short for powershell

tidal latch
#

PowerShell VS Windows PowerShell.

rancid wadi
#

oh ok

#

so that explains why when i call powershell it oputputs windows powershell

tidal latch
#

What do you mean?

rancid wadi
#

well the thing is that um when i typr powershell it outputs my windows powershell config and not powershell core

olive magnet
#

Can't you tell because Windows PowerShell is ... blue?

olive magnet
#

I can tell because I put a background on it:

rancid wadi
#

how?

#

oh backgroud image?

olive magnet
#

yeah

rancid wadi
#

but do share it

#

i need em

rancid wadi
rancid wadi
#

oh i struggled so much trying to find the powershell preview icon TT_TT to put it on my profile list

olive magnet
#

the .ico version is there in that folder too

rancid wadi
#

and i didnt even get a clear one TT_TT

#

oh

rancid wadi
#

you are a lifesaver

#

TT_TT

olive magnet
#

I still need to do a few more

#

Oh, and chec out those avif one ๐Ÿ˜‰

#

it's so purrrdy

rancid wadi
#

broooo

#

you are even more helpful than family XD

olive magnet
#

lol

rancid wadi
#

so cool image

#

but can you tell me the location

#

i cant seem to find it i am bad at scrolling file

#

to lazy actually XD

olive magnet
#

I'll point you to the original author instead ๐Ÿ˜‰

rancid wadi
#

thank you so much

rancid wadi
#

this is by far the most helpful community server

olive magnet
#

He has sooo many nice ones

rancid wadi
#

also are you awake late at night?

rancid wadi
rancid wadi
olive magnet
#

lol, nah it's only 11

rancid wadi
#

its 10 am here

olive magnet
#

I'm trying to decide how to get my PowerLine module to build with a dependency on a pre-release version of my TerminalBlocks.

rancid wadi
#

oh

#

i thought you were free but i was keeping you from sleeping

olive magnet
#

just free time messing around

#

watching TV before bed

rancid wadi
#

lol

#

habits i guess

#

by the way where did you find the icons and background icons of powershell etc

olive magnet
#

ยฏ_(ใƒ„)_/ยฏ I've been collecting for decades ๐Ÿ˜‰

rancid wadi
#

TT_TT

#

for decades really?

#

but i cant seem to find images

#

did you keep them in terminal profile? or on seperate dir as photo?

#

oh found it ๐Ÿ™‚

rancid wadi
#

By the way I have been meaning to ask

#

Power line setup is difficult

#

Cuz I will use powershell with starship normally but on windows PowerShell with powerline

hybrid plaza
olive magnet
#

And why do you think it's difficult?

#

Honestly, I should have you try the 4.0 preview, because the whole focus there is to make it easier to set up

#

But I'm curious

olive magnet
#

The problem with starship is the actual model

#

It's an executable that has to parse it's config and recreate everything from scratch each time it runs

rancid wadi
#

True

#

But honestly with my hardware though I am satisfied

rancid wadi
# olive magnet why?

Well cuz um I dont really prefer windows PowerShell
And I like customization to be easy and not be too nerdy ๐Ÿค“ um don't take it to heart

#

Its just in my opinion

#

๐Ÿ™‚

hybrid plaza
olive magnet
#

@rancid wadi what's your starship config look like?

rancid wadi
#

Wait

#

@olive magnet

#

lol i moved to fish now

#

from bash to zsh to fish

rancid wadi
#

Also the right prompt setup on the input

#

The fill module works

#

But still want to um experiment and you guys are the pros when it comes to this so

rancid wadi
#

hello

#

why dead TT_TT

#

also i have been to ask but i cant install powershell on kali linux

#

why though?

olive magnet
#

Yes, why? On Kali you should be able to just sudo apt install powershell

rancid wadi
#

it doesnt work though

#

for example the preview version

#

wait weird

#

i tried for like the past month but couldnt get it done

#

tried ubuntu big fail

#

but surprisingly today it works al of a sudden?

#

also like how do i execute it i dont have a graphical interface command only guy ๐Ÿ™‚

rancid wadi
#

by the way

#

@tidal latch um the short profile dont seem to work

#

i tried everything the same way but it says unknown

tidal latch
#

Latest version of starship?

olive magnet
#

you execute it by running pwsh

#

๐Ÿ˜›

rancid wadi
rancid wadi
rancid wadi
tidal latch
rancid wadi
#

Will check

#

But is there any options necessary for profile short

#

Also I configured it on starship.toml

#

As ```toml
[profile]
short
......

rancid wadi
#

@tidal latch

#

hello

#

so um i checked

#

and i removed profile short it seems to support it but it doesnt output thouh

#

doing it manually on the command line works

#

but not in profile

rancid wadi
#

Well โค๏ธโ€๐Ÿฉน problem solved ๐Ÿ˜‰

#

Did some brainstorming

#

But doesn't seem to work on powershell

#

LoL

rancid wadi
#

Why is it dead???

olive magnet
#

What's dead?

rancid wadi
#

The chat

rancid wadi
#

@tidal latch sorry for the ping but I tried the code like I said it works manually but if I set it starship on powershell profile it doesn't output saying error

#

What do I do?

#

Pls take responsibility ๐Ÿ˜‰๐Ÿ™‚

olive magnet
#

if starship isn't working, you probably need to check the starship setup is in your profile right

tidal latch
rancid wadi
#

I used the same call you gave

#

But I modified the co fig of short prompt works fine on fish

#

But idk

#

I think the problem is with the call cuz for fish it worked fine by using ```toml
Starship prompt --profile short

#

But using the samething on powershell doesn't work I mean only this line outputs error no functions like this 3xist

#

But doing it manuall works

rancid wadi
rancid wadi
tidal latch
rancid wadi
#

My PC died

#

Well charger died so battery dead

#

TT_TT

tidal latch
rancid wadi
#

Now I am stuck but mainly it says that prompt profile option doesn't exist from the PS1

#

Oh

#

Ok

#

I will try it

#

Exams going on

#

Didn't have time

#

I mean that on the PS1 on prompt call I just edited prompt to prompt profile short syntax okay

tidal latch
rancid wadi
#

this is the output

#
Invoke-Expression (&starship init powershell)

function Invoke-Starship-TransientFunction {
    &starship prompt --profile short
}

Enable-TransientPrompt
#

this is in my starship.toml```toml
[profiles]
short = """
๏““ $directory $fill
$time
\n ๓ฐคน ๎˜ก๎‚ฐ๎‚ฑ
"""

tidal latch
#

I'm not sure. Make sure your running the latest version.

rancid wadi
#

It is though

#

But works in VSC terminal with problems but it shows the prompt

#

Well broken type prompt rather than not showing it

#

LoL

tidal latch
#

So the transient prompt reverts to PS>?

rancid wadi
#

yeah

#

i dont know why

#

worst thing is the fill moudule justt keeps on expanding in vscode

#

works fine on wsl vscode session

#

lol

#

sorry

#

laptop died

#

so i couldnt reply back

rancid wadi
#

umm sooo anyone there?

olive magnet
#

hehe, I really can't help you, because I don't use the tools you're using ๐Ÿ˜‰

tepid plover
# rancid wadi

In the picture there what are using to display specs ?

tepid plover
# rancid wadi

Hey see the windows specs in your picture how did you get that ?? Whatโ€™s it called thank you

rancid wadi
#

Sorry I was inactive

#

Pls don't mind

#

If you want to know more about my setup I am happy to help

#

Everything is custom made

#

๐Ÿ™‚

#

Everything is in my GitHub

#

Check my profile if you don't find it make sure to knock

#

Cuz I am too lazy to actually search for links right now

tepid plover
#

Just wanted to see how that specs was made looks pretty similar to my batch file specs lol cool Iโ€™ll check it out

rancid wadi
#

batch file?

#

well no but customizing neofetch is a hassle its cutom made

#

cuz i spent around an entire day customizing it

#

lol

#

by the way can i check your one out?

rancid wadi
rancid wadi
#

neofetch configurations pick one you like

#

2 versions

#

you can modify it and maybe contribute it in my repo in a different folder ๐Ÿ™‚

#

๐Ÿ™‚

#

man i feel like this issue is um changing contents

#

lol

#

ps: make sure to let me know if you like it

tidal latch
#

If that had the proper escape sequences around the prompt it should be easy to find and replace it. I'm not sure that they do though ๐Ÿค”

rancid wadi
#

Idk

#

A gentle man in starship helped

#

Well I think problems with starship parser

#

Or maybe something unsupported on my end

#

I mean I was skeptical at first by command but worked anyways

#

Also starship didn't really have much of a guide on this

rancid wadi
rancid wadi
warm frigate
#

wait, this powt has how many answers? wtf

rancid wadi
#

LoL

#

It's and entire advanced level config discussion going on here

#

Feel free to use them

#

But you need to scroll and find it on your own lol

rancid wadi
#

well this is dead what to do now?

rancid wadi
#

lol

#

forgot to wish happy new year but oh well

rancid wadi
#

damn

#

dead

rancid wadi
#

anyone here who is a front end dev?

#

need help

lone dove
#

you're a bit isolated here now in your forum thread. You've a relatively small number of people watching.

I'm not a front end dev, but you should come and join us on #bridge or even #powershell-help and ask there ๐Ÿ™‚

rancid wadi
#

lol

#

ok

#

but anyways

#

i need help

#

so i officialy switched to linux

#

but vscode doesnt seem to accept jetbrainst mono nerdfont

#

and i tried various ways

#

but its not really working

#

TT_TT

#

i use arch btw

rancid wadi
#

Hey @here

#

Pls help ne

#

Cuz I can't seem to upgrade PowerShell on linux

#

I use arch and PowerShell isn't well supported in Linux

#

Well in arch to be honest

rancid wadi
# lone dove you're a bit isolated here now in your forum thread. You've a relatively small n...

Well that's not the problem anymore
The problem right now is that PowerShell has really scarce support on arch Linux and arch based distros it would be great it was officially maintained cuz preview packages don't seem to update and I have been dying and feeling uncomfortable PowerShell maybe cross platform but it's way different there should be shell commands like on bash zsh etc Like unix compliant shell if possible cuz PowerShell is great but kinda limited cooming as a windows user it felt very smooth but Linux it's very rough and not really friendly

#

In my opinion

warm frigate
#

Oh, why you use Arch?

static thorn
rancid wadi
#

But implementibg is good I think

rancid wadi
#

I am confused by the issues page

#

Pls help me

static thorn
#

No.

rancid wadi
#

Bruhhh

#

Oh well

#

Zsh for linux pwsh for windows stonks ๐Ÿ“ˆ๐Ÿ“ˆ๐Ÿ“ˆ

near pebble
#

This forum needs to die. Just start a new one with a new topic.

rancid wadi
#

Nope

#

I like this one

#

But I will

#

But it just has so many messages

#

And I don't want it to die ๐Ÿ˜ญ๐Ÿ˜ญ

static thorn
near pebble
static thorn
#

I am doing that right now...