工具与资源github.com
lsix:终端里的图片版 ls
lsix: ls for images
2018 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
lsix 是一个在终端里列出图片缩略图的命令行工具,相当于图片版的 ls。它利用支持 Sixel 图形协议的终端(如 xterm)直接在命令行中显示图片预览,2018 年和 2024 年两度登上 Hacker News 首页。
为什么经久不衰:它把 Unix 命令行的简洁哲学延伸到了图片浏览,且随着终端图形支持的普及(Sixel、Kitty 图形协议等)重新受到关注,至今仍是终端工作流中查看图片的实用工具。
HN 评论精选
iTerm2 用户有自带的 imgls/imgcat 可实现类似功能
顺带一提:虽然 iTerm2(macOS)似乎不支持这个工具,但 iTerm2 实际上支持全彩内联图片,并有一个功能类似的 imgls 脚本(还有 imgcat)。
isomorphic查看英文原文
Aside: Although iTerm2 (on macOS) doesn't appear to work with this, iTerm2 actually supports full-color inline images, and has an "imgls" script which does something similar. (There's also "imgcat".) https://www.iterm2.com/documentation-images.html
提醒 ImageMagick 处理不可信图片文件存在安全风险
把不可信的输入喂给 ImageMagick 要小心。在你的下载目录里运行这个工具,结果可能出乎意料。
tedunangst查看英文原文
I would be wary about feeding untrusted inputs to imagemagick. Running this in your downloads directory could be surprising.
批评 lsix 默认隐藏某些格式的做法违背了命令行工具应有一致性的原则
你也可以指定文件名,当然还能用 shell 通配符。不过有些格式渲染很慢(比如 PDF),所以 lsix 默认不显示它们,除非你明确要求。无论如何,我认为在这样一个命令行工具里制造这类例外/边缘行为从来不是好主意——相当于普通 ls 里“默认不显示超过 X 个文件,除非你明确要求”,只会带来更多困惑。作为多年命令行用户,好易用性必备的特质是一致性;一堆边缘情况和特殊行为会让工具除了最基础的操作外都难以使用。
userbinator查看英文原文
You can also specify filenames and, of course, use shell wild cards However, some may be slow to render (like PDF), so lsix doesn't show them unless you ask specifically. Regardless of the justification, I don't think creating such extra exception/edge-case behaviours are ever a good idea in a commandline tool like this. The equivalent in regular ls would be something like not showing more than X files "unless you ask specifically" --- which would just create more confusion than anything. As someone who has used the commandline for many years, one property which needs to be present for good usability is consistency. Having a bunch of edge-cases and special behaviours makes a tool hard to use for anything but the most extremely basic of operations.
Emacs 的 iimage-mode 也能在 eshell 中内联显示图片
半相关的趣事:如果你在 Emacs 里开启了 iimage-mode(新版本可能是默认开启?),在 eshell 里直接 cat 图片就能像这个工具一样显示出来。可惜它还不支持终端里的 Sixel 图形。
snazz查看英文原文
Semi-related fun fact: if you have iimage-mode turned on in Emacs (it might be the default on recent versions?), you can just cat images in eshell and have them show up just like this app. Unfortunately it doesn't do sixel graphics in a terminal yet.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com