Tratar con Powershell y hacer que el terminal de Windows sea utilizable







No es ningún secreto que, por defecto, el terminal de Windows sigue siendo una muleta. El terminal estándar fue reemplazado por el terminal Powershell en 2006. Luego, aunque fue un gran avance, el terminal todavía no era tan conveniente como lo era en Linux con su Bash. Microsoft ideó una sintaxis de comando bastante mala -



, que formó la base de toda la sintaxis de Powershell y no le permitió trabajar rápidamente con el terminal. No de inmediato, pero después de varios lanzamientos, se agregaron alias, al principio imitaron comandos de cmd, y luego adoptaron comandos bash como cp, mv, rm, ps, etc. (de hecho, estos no son comandos, sino simplemente abreviaturas que consulte los comandos estándar de Powershell).







En este mini-artículo intentaré solucionar los problemas del inconveniente emulador de terminal en Windows, así como la falta de alguna funcionalidad en el mismo.







5- (Zsh, Bash, Fish..) - , . . Powershell . . , , . , , .







, Linux?



Linux. , , , . - , , Linux, - , , - , , , - - . , .







Windows , , , , , ( ) , .







Windows — . Linux-like.







Windows Terminal



Windows Terminal. .json



. — . , , (Ctrl + Alt + ,



), ,













colorScheme



, , . .







, , Linux, , .







Powershell



. , , . . 2 : , , , Git', , , , - , ( fish) — .







, , oh-my-posh. :







Install-Module oh-my-posh -Scope CurrentUser #   oh-my-posh
Install-Module posh-git -Scope CurrentUser #    ,    git'
      
      





, Get-Theme



, Set-Theme



:







PS C:\Users\Daniil_Shilo> Get-Theme

Name                  Type     Location
----                  ----     --------
Agnoster              Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\A...
AgnosterPlus          Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\A...
Avit                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\A...
cypher                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\c...
Darkblood             Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\D...
Emodipt               Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\E...
Fish                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\F...
Honukai               Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\H...
Lambda                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\L...
Material              Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\M...
Operator              Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\O...
Paradox               Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Pararussel            Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Powerlevel10k-Classic Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Powerlevel10k-Lean    Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Powerlevel9k          Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
PowerLine             Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
PowerlinePlus         Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Punk                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
pure                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\p...
qwerty                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\q...
robbyrussell          Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\r...
Sorin                 Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\S...
Star                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\S...
tehrob                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\t...
ys                    Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\y...
Zash                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\Z...

Set-Theme ys
      
      











. , .









, Chocolatey. , , Linux- ( ).







:







Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
      
      





Chocolatey, - Google Chrome, Firefox, Docker, VSCode, . , Windows,







, Chocolatey, . . , Approved.




Chocolatey Powershell, , Linux. search.







% choco search Google Chrome
Chocolatey v0.10.15
GoogleChrome 88.0.4324.146 [Approved]
google-hangouts-chrome 2017.110.418.20 [Approved]
google-translate-chrome 2.0.7 [Approved]
...
      
      







( ).







% choco install <_>
      
      





:







% choco list --local-only
      
      





- :







% choco uninstall <_>
      
      







Aunque el terminal en Windows todavía no es tan funcional, creo que tarde o temprano esto cambiará, aunque solo sea por la integración de Linux en Windows (WSL). Creo que ya puedes usar el terminal con calma, porque la gente sigue creando algo nuevo para dar nueva vida al emulador de terminal de Windows.







Si estaba interesado, puede leer mi blog en el carrito , hay muchas cosas interesantes sobre el mundo de Linux, así como sobre el desarrollo web.








All Articles