When tstyles shell-init finds no rc file at all, it creates one for the login
shell rather than silently doing nothing (terminals.ps1, ~line 616):
$loginShell = if ($env:SHELL -and $env:SHELL -match 'zsh') { 'zsh' } else { 'bash' }
$target = $candidates | Where-Object Shell -eq $loginShell | Select-Object -First 1
Get-ShellRcCandidate returns the bash candidates in the order .bashrc,
.bash_profile, so -First 1 always picks .bashrc.
That is the wrong file on macOS, and the reason is documented two functions
away, in Get-ShellRcCandidate's own comment:
~/.bash_profile is included because macOS Terminal.app starts bash as a
LOGIN shell, which reads .bash_profile and never .bashrc.
So on a fresh macOS machine whose login shell is bash and which has no rc files
yet, shell-init creates ~/.bashrc, reports success, and the shell never
reads it.
Expected
Create the file the login shell will actually read — .bash_profile on macOS,
.bashrc on Linux.
Why this is a good first issue
The reasoning is already written down in the file; this is about applying it in
one more place. Get-TStylesPlatform gives you the platform, and
tests/Shell-Integration.Tests.ps1 shows how the rc-file paths are faked.
When
tstyles shell-initfinds no rc file at all, it creates one for the loginshell rather than silently doing nothing (
terminals.ps1, ~line 616):Get-ShellRcCandidatereturns the bash candidates in the order.bashrc,.bash_profile, so-First 1always picks.bashrc.That is the wrong file on macOS, and the reason is documented two functions
away, in
Get-ShellRcCandidate's own comment:So on a fresh macOS machine whose login shell is bash and which has no rc files
yet,
shell-initcreates~/.bashrc, reports success, and the shell neverreads it.
Expected
Create the file the login shell will actually read —
.bash_profileon macOS,.bashrcon Linux.Why this is a good first issue
The reasoning is already written down in the file; this is about applying it in
one more place.
Get-TStylesPlatformgives you the platform, andtests/Shell-Integration.Tests.ps1shows how the rc-file paths are faked.