Skip to content

Figure out aliases #929

Closed
Closed

Description

The PowerShell aliases that conflicted with Linux and OS X were removed in #786, specifically commit 7d9f439.

However, new discussion is happening on how to handle this better than just removing the aliases.

Activity

  1. added
    Usability(LEGACY) Helps filter issues that might be higher priority because they directly affect usability
    Issue-Metaan issue used to track multiple issues
    on Apr 28, 2016
  2. added this to the milestone on Apr 28, 2016
  3. andyleejordan commented on May 4, 2016

    @andyleejordan
    MemberAuthor

    This makes using rm, ls, etc. sucky, since globbing isn't performed:

    > touch blah.tmp
    > ls *.tmp                                                                                                          
    ls: *.tmp: No such file or directory
    > Get-ChildItem *.tmp
    
        Directory: /Users/andrew/src/PowerShell
    
    
    Mode                LastWriteTime         Length Name                                                                                 
    ----                -------------         ------ ----                                                                                 
    ------           5/3/16   8:39 PM              0 blah.tmp
    
    > rm *.tmp
    rm: *.tmp: No such file or directory
    > Remove-Item *.tmp
    > Get-ChildItem *.tmp
    

    Blah.

  4. joeyaiello commented on May 5, 2016

    @joeyaiello
    Contributor

    Usability sync generally agrees that the interactive experience sucks without the aliases. What we don't agree on is what alternatives should be offered to users who want to use the native binaries by default. Some options that have been floated include:

    • An environment variable to turn off all the aliases that collide with *nix binaries
    • A single character (like ^) that automatically falls into the native PATH
    • Tell people they have to bash -c (many said this is too many characters to be usable)
    • Tell people that they have to provide the full path (this experience technically already works, but it's very poor)
    • Side suggestion: Leverage the "hinting subsystem" to tell people that they may have wanted to use the native command if they use parameter sets that match patterns against the native *nix binaries. This can still only work when the command fails (rm -e, for instance, would not fail).
  5. modified the milestones: v0.5.0, on May 18, 2016
  6. andyleejordan commented on May 18, 2016

    @andyleejordan
    MemberAuthor

    I think this is something we want to figure out sooner rather than later, so I've moved it to v0.5.0. In my opinion, a PowerShell setting to switch modes is the best first step.

  7. vors commented on May 18, 2016

    @vors
    Collaborator

    Andy Jordan (@andschwa) and default would be ....?

  8. andyleejordan commented on May 18, 2016

    @andyleejordan
    MemberAuthor

    sergei (@vors) my personal opinion: the PowerShell aliases enabled; because you're running PowerShell.

    Eventually we're going to want a first-time startup "getting started" guide for PowerShell anyway, and would state that this is an available setting.

  9. 64 remaining items

  10. rkeithhill commented on Sep 6, 2016

    @rkeithhill
    Collaborator

    Gaelan Steele (@Gaelan) So I shouldn't use PowerShell if I need to use gcc or git? What's wrong with letting folks decide if they want text (ls) or objects (gci)? There are more reasons to use PowerShell than just its OO nature - powerful as it is. Heck I'd rather use PowerShell just for its C/C# like control flow statements (vs if/fi and switch case/esac) and its proper type system (where numbers are numbers and not strings).

  11. Gaelan commented on Sep 6, 2016

    @Gaelan

    Keith Hill (@rkeithhill)

    So I shouldn't use PowerShell if I need to use gcc or git?

    On a *nix system, if users just wanted to use the shell for gcc or git they wouldn't bother with PowerShell, because the shell that came with their OS does that perfectly well.

    Heck I'd rather use PowerShell just for its C/C# like control flow statements (vs if/fi and switch case/esac)

    Perhaps if someone was already using PowerShell they would prefer it because of that, but I doubt that someone would install PS just for that.

    its proper type system (where numbers are numbers and not strings)

    /bin/ls doesn't work with the type system either: if I run ls -l, I will get file sizes as a string instead of a proper PS number.

    I feel like the reasons a new user would switch to PS on *nix largely revolve around the OO and the type system. We should make it as easy as possible for new users to get started with PS–if I saw something about PS, tried to check it out, only to discover that I needed to relearn everything about the command line to use it, I would probably be much less likely to bother with learning it than if I could fire up PS, type ls and immediately see the type system in action. Yes, I could use aliases, but if I'm just trying out PS in a few spare minutes I'm unlikely to want to do much configuration before I jump in and start playing around.

  12. ForNeVeR commented on Sep 6, 2016

    @ForNeVeR
    Contributor

    On a *nix system, if users just wanted to use the shell for gcc or git they wouldn't bother with PowerShell, because the shell that came with their OS does that perfectly well.

    Perhaps if someone was already using PowerShell they would prefer it because of that, but I doubt that someone would install PS just for that.

    Sorry, but I strongly disagree. As a Linux user, I want to use PowerShell instead of shell that came with my OS. For everything. Because it's awesome, you know :)

    Heck, I am even packaging PowerShell for NixOS right now just to use it for everything.

    Please consider that our target users are not only native Unix users who accidentally use Windows+PowerShell, but also Windows users who accidentally use Unix+PowerShell ;)

  13. modified the milestones: , post-6.0.0 on Oct 17, 2016
  14. xoofx commented on Nov 19, 2016

    @xoofx

    A single character (like ^) that automatically falls into the native PATH

    I would also prefer to keep aliases compatible across OS whenever they are valid on these platforms and use an escape character (like ^ls) to get an implicit access to native commands, as suggested by Joey Aiello (@joeyaiello)
    I'm not familiar with the whole PowersShell philosophy, but what could be wrong with such an approach?

  15. vors commented on Dec 7, 2016

    @vors
    Collaborator

    Actually, one more point for using a single-character escaping: bash already does it. https://twitter.com/climagic/status/806536501232340992

    \ls ignores all aliases.

  16. Liturgist commented on Feb 20, 2017

    @Liturgist

    Is the answer to aliases solved by enabling WSL (Windows Subsystem for Linux)? This will provide native sed, awk, ls, etc. commands in a bash shell.

    While it is still beta code for Windows 10, surely it will be coming and made available in Server 2016 and 2012.

  17. bgshacklett commented on Feb 21, 2017

    @bgshacklett

    Liturgist Currently, the WSL is a very separate environment from PowerShell. The commands are not callable from a PowerShell session. Additionally, this would likely be considered a regression by many current Windows PowerShell users as many scripts would break if they received the output from, say, GNU ls rather than ls -> Get-ChildItem. While the use of aliases was never recommended in scripts, the fact remains that they have been used and breakage would cause difficulty for many people.

  18. joeyaiello commented on Feb 21, 2017

    @joeyaiello
    Contributor

    Liturgist: Brian G. Shacklett (@bgshacklett) is on right here. The problem is not that something happens when you type ls, the question is what parameters you expect while using that, and whether or not the output emitted is consumable in an object-oriented fashion by other PowerShell cmdlets (i.e. ls | Where-Object Name -like *foo* won't work if you're using the WSL ls).

  19. SteveL-MSFT commented on Apr 18, 2017

    @SteveL-MSFT
    Member

    The original issue with conflicting aliases with native cmds has been addressed. If there is a need to have the capability to add back popular Windows PowerShell aliases, that should be a separate issue.

  20. SteveL-MSFT commented on Apr 20, 2017

    @SteveL-MSFT
    Member

    Opened #3610 to capture secondary issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifOS-LinuxOS-macOSResolution-FixedThe issue is fixed.Usability(LEGACY) Helps filter issues that might be higher priority because they directly affect usabilityWG-DevEx-Portabilityauthoring cross-platform or cross-architecture modules, cmdlets, and scripts

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions