PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.2k stars 739 forks source link

Winget (and MSI) installer updates PATH but does not tell user to restart their shell #2208

Open phil-blain opened 4 months ago

phil-blain commented 4 months ago

Summary of the new feature / enhancement

As a user, I like that winget install Microsoft.OpenSSH.Beta updates PATH to include the just-installed binaries (which is done since https://github.com/PowerShell/openssh-portable/pull/622), but it would be even better if the installation procedure showed a message saying one must restart their shell/terminal for the new binaries to be available.

Right now this is the output I get (pardon my French):

PS C:\Users\me\Downloads> winget install Microsoft.OpenSSH.Beta
Trouvé OpenSSH Beta [Microsoft.OpenSSH.Beta] Version 9.5.0.0
La licence d’utilisation de cette application vous est octroyée par son propriétaire.
Microsoft n’est pas responsable des paquets tiers et n’accorde pas de licences à ceux-ci.
Téléchargement en cours https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.5.0.0p1-Beta/OpenSSH-Win64-v9.5.0.0.msi
  ██████████████████████████████  5.47 MB / 5.47 MB
Le code de hachage de l’installation a été vérifié avec succès
Démarrage du package d’installation... Merci de patienter.
Installé correctement
PS C:\Users\me\Downloads> gcm -all ssh | format-table -autosize

CommandType Name    Version Source
----------- ----    ------- ------
Application ssh.exe 8.9.1.0 C:\Users\me\AppData\Local\Programs\OpenSSH-Win64\ssh.exe
Application ssh.exe 8.1.0.1 C:\Windows\System32\OpenSSH\ssh.exe

i.e. PATH is not updated in the current shell so it only finds my previous (user-level) install and the system one, not the newly installed 9.5 version. It showed up correctly once I opened a new tab in Windows Terminal.

Proposed technical implementation details (optional)

The MSI installer should, in my opinion:

  1. Tell the user where it installed the binaries
  2. Tell the user to restart their shell / terminal program for the PATH modification to take effect
  3. The winget install should pass through those messages.

Cheers!