ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
849 stars 276 forks source link

Read ~/.bashrc When Running A .fsx Script? #1983

Closed eatobin closed 4 months ago

eatobin commented 4 months ago

Hello -

Is there a way to have your ~/.bashrc read when running a .fsx script? I'm trying to set my terminal prompt correctly and I've included a screenshot of the current output - which I'd like to change to reflect my PS1.

Thank you!

prompt

MangelMaxime commented 4 months ago

To me it looks like there is a mix happening here. Because, you are trying to setup a Powershell configuration from inside a .bashrc which is in general associated to bash and not Powershell.

I think customisation of Powershell should be done inside the $PROFILE code.

Exemple: notepad $PROFILE

https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup#choose-and-apply-a-powershell-prompt-theme

eatobin commented 4 months ago

@MangelMaxime Thank you - but I don't understand. Where does Powershell come in? I am on Linux (Ubuntu) and use bash. Is Powershell used by Ionide-VSCode to run a .fsx script?

MangelMaxime commented 4 months ago

Oops sorry I thought PS1 was related to PowerShell as when quickly looking at the screenshot I thought that the window I took for a window terminal (Sublime Text) looked similar to Windows Terminal.

I was probably not properly awake this morning 😅

eatobin commented 4 months ago

No problem. Any thoughts on how to read the .bashrc file before running a .fsx in ionide?

Sent from my rotaryPhone.

On Tue, Feb 6, 2024, 10:45 Maxime Mangel @.***> wrote:

Oops sorry I thought PS1 was related to PowerShell as when quickly looking at the screenshot I thought that the window I took for a window terminal (Sublime Text) looked similar to Windows Terminal.

I was probably not properly awake this morning 😅

— Reply to this email directly, view it on GitHub https://github.com/ionide/ionide-vscode-fsharp/issues/1983#issuecomment-1930457663, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGUSKUFEKQCLMJ64EQRDC3YSJT3DAVCNFSM6AAAAABC25KMHGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZQGQ2TONRWGM . You are receiving this because you authored the thread.Message ID: @.***>

MangelMaxime commented 4 months ago

We don't spawn the terminal ourself, it is given to use by VSCode API.

https://github.com/ionide/ionide-vscode-fsharp/blob/29205de7dd1467a21210a9d18a20b79e4b34d752/src/Components/Fsi.fs#L419-L455

I don't know if there any arguments or configuration can be made for it.

eatobin commented 4 months ago

@MangelMaxime Thank you. I'll just live with it. :-)

eatobin commented 4 months ago

Bye.