V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
bologer
V2EX  ›  Windows

为什么 Windows 命令行工具很难用?新出的 terminal 也一样

  •  
  •   bologer · 2021-09-07 01:32:42 +08:00 · 4109 次点击
    这是一个创建于 955 天前的主题,其中的信息可能已经有所发展或是发生改变。

    不能贴图片呢。。。 那贴原文吧,用 git husky 做 commit 校验,然后每敲一个字符都换一行,还有很多情况都是这样,特别难用,mac 就不会,这是为什么呢? Windows 原罪? ? Write a short, imperative tense description of the change (max 93 chars): (0) ? Write a short, imperative tense description of the change (max 93 chars): (1) x? Write a short, imperative tense description of the change (max 93 chars): (2) xi? Write a short, imperative tense description of the change (max 93 chars): (3) xiu? Write a short, imperative tense description of the change (max 93 chars): (4) xiug? Write a short, imperative tense description of the change (max 93 chars): (5) xiuga? Write a short, imperative tense description of the change (max 93 chars): (6) xiugai? Write a short, imperative tense description of the change (max 93 chars): (5) xiuga? Write a short, imperative tense description of the change (max 93 chars): (4) xiug? Write a short, imperative tense description of the change (max 93 chars): (3) xiu? Write a short, imperative tense description of the change (max 93 chars): (2) xi? Write a short, imperative tense description of the change (max 93 chars): (1) x? Write a short, imperative tense description of the change (max 93 chars): (0) ? Write a short, imperative tense description of the change (max 93 chars): (1) 修? Write a short, imperative tense description of the change (max 93 chars): (2) 修改? Write a short, imperative tense description of the change (max 93 chars): (3) 修改引? Write a short, imperative tense description of the change (max 93 chars): (4) 修改引入? Write a short, imperative tense description of the change (max 93 chars): (5) 修改引入 s? Write a short, imperative tense description of the change (max 93 chars): (6) 修改引入 sd? Write a short, imperative tense description of the change (max 93 chars): (7) 修改引入 sdk? Write a short, imperative tense description of the change (max 93 chars): (8) 修改引入 sdk 版? Write a short, imperative tense description of the change (max 93 chars): (9) 修改引入 sdk 版本? Write a short, imperative tense description of the change (max 93 chars): (9) 修改引入 sdk 版本 ? Provide a longer description of the change: (press enter to skip) ? Provide a longer description of the change: (press enter to skip)

    19 条回复    2021-09-08 08:45:15 +08:00
    Tumblr
        1
    Tumblr  
       2021-09-07 01:34:41 +08:00
    。。。就这排版,这个观点很难有说服力啊。
    icy37785
        2
    icy37785  
       2021-09-07 03:30:11 +08:00 via iPhone
    排版让我不是太理解你遇到的问题,所以也挺难理解你说的难用。反正我是认为现在的 windows 命令行已经不差了。
    felixcode
        3
    felixcode  
       2021-09-07 03:55:01 +08:00 via Android
    Windows 的原罪? 一个终端输入问题就能引出这么深刻的哲学话题。
    还是用回 mac 吧。
    alphatoad
        4
    alphatoad  
       2021-09-07 04:56:05 +08:00   ❤️ 4
    Windows Terminal 只是个前端,shell 还是 cmd 或者 PowerShell 。PowerShell 是个不错的脚本语言,但是真的用来当日常的终端就难受了
    一个更好的问题是,用户想要 mingw 这样的 posix 兼容 api 方便原生开发和命令行程序移植,但是微软却给了你一个 Linux 虚拟机
    kingfalse
        5
    kingfalse  
       2021-09-07 07:26:54 +08:00 via Android
    你但凡会截个图,也不至于这么***
    om2mo
        6
    om2mo  
       2021-09-07 08:04:30 +08:00 via iPhone
    不知道你用的是 cmd 还是 powershell,反正肯定不是 wsl,不然就没这些问题了
    Zhongwei
        7
    Zhongwei  
       2021-09-07 08:44:24 +08:00   ❤️ 1
    就你这排版,还好意思 diss 我巨伟大的 terminal
    rioshikelong121
        8
    rioshikelong121  
       2021-09-07 09:30:00 +08:00
    先问是不是 再问为什么
    marcong95
        9
    marcong95  
       2021-09-07 09:30:01 +08:00   ❤️ 2
    为什么不是你说的 husky 对 cmd/powershell 的兼容性有问题,而一上来就直怼 windows 呢,也不见其他 Interactive CLI 有问题,例如 npm init 啥的

    此外本站发帖是 markdown 语法,分段需要多一个空行。
    2i2Re2PLMaDnghL
        10
    2i2Re2PLMaDnghL  
       2021-09-07 09:33:16 +08:00
    原罪,或称原罪论,是部分基督教具基本教义派的神学家提倡的神学理论,其他的亚伯拉罕宗教如犹太教(但哈雷迪犹太教认可)与回教则无原罪一说。原罪的定义上一般而言是指希伯来圣经记载的第一个男人亚当和第一个女人夏娃在伊甸园尝禁果后,犯了“罪”而被迫离开伊甸园,但亦为人类文明及开始通过性爱而繁衍后代的起点。
    jackmod
        11
    jackmod  
       2021-09-07 09:35:41 +08:00
    用 \r 重写输出就容易遇到这种问题。
    winapi 有专门的清空 console 的函数,但不通用,一般人也懒得去用。
    建议增加窗口宽度。
    iSecret
        12
    iSecret  
       2021-09-07 09:46:59 +08:00
    PowerShell 语法是真的难写,命令又臭又长。
    dingyx99
        13
    dingyx99  
       2021-09-07 09:49:31 +08:00
    你这排版。。。直接不想看了
    azkaban
        14
    azkaban  
       2021-09-07 10:33:00 +08:00
    @alphatoad 但是这个虚拟机缺全后台自动托管,启动也贼快,睡眠开机都是即刻使用,两边文件互通,完全无感知,除了巨硬技术 nb 还能说什么
    stroh
        15
    stroh  
       2021-09-07 10:39:15 +08:00
    用过 mac 的 iterm2 后再也不想回 windows 了
    Tumblr
        16
    Tumblr  
       2021-09-07 10:39:16 +08:00
    @iSecret #12 有个按键叫 tab😌有个功能叫自动补全😌有个 module 叫 psreadline 提供历史记录😌
    zjsxwc
        17
    zjsxwc  
       2021-09-07 12:21:45 +08:00
    写 PowerShell 需要 IDE,因为我觉得 PowerShell 是和 C#一个级别的
    alphatoad
        18
    alphatoad  
       2021-09-08 00:51:24 +08:00
    @azkaban 没错,这不是最差的方案,但也不是最好的
    我不太明白为什么微软这么执着于复刻 Linux API,明明以自己的技术水平可以把 windows 做成最好的 Unix 兼容发行版
    PbCopy111
        19
    PbCopy111  
       2021-09-08 08:45:15 +08:00
    为什么每次 powershell 启动都需要 2 秒多的时间????怎么看是卡在那步了?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3384 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 00:39 · PVG 08:39 · LAX 17:39 · JFK 20:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.