Mutt 現有維護者的節能宣告

Hacker News 上看到「Mutt 2.2.0 (mutt.org)」這篇,Mutt 的維護者 (應該是 Kevin McCarthy) 將只會負責 fix 類的事情了:

This obviously isn't a feature, but I wanted to mention that I will be moving away from Mutt maintainership after this release. There isn't a transition plan, so I'll keep maintaining the 2.2.x series with bug fixes and security issues.

It's been my pleasure to keep the releases coming since version 1.5.24. Unfortunately the past year, my time and energy available has been decreasing. So my plan is to focus the time I do have on keeping Mutt stable, secure, and bug free; until someone else has the desire to head up (and support) new-feature releases. Thank you everyone!

有人在討論串裡提到了 NeoMutt,也許之後會找機會看看...

目前還是有一套 email system 是跑在 Postfix + Procmail + Bogofilter + Mutt 上面,短期內應該不會換...

用 vttest 測試 terminal 程式實做的相容性

看到「Wez's Terminal」,又一個用 GPU 加速的 terminal 專案,跑去翻一下 Hacker News 上的討論,意外的翻到有趣的東西:「Wezterm – A GPU-accelerated cross-platform terminal emulator and multiplexer (github.com/wez)」。

目前最前面的討論是這個:

I just saw this and after a quick checkout of the latest release (which is what I can quickly install), I feel a bit disappointed. Here is yet another GPU-accelerated terminal that claims to be a VT500 (judging by its Device Attributes report), sets TERM to xterm-256color, while having holes in basic VT100 support (just ran VTTEST in it and saw glaring issues, need not look further than basic VT100 tests, TAB setting/resetting, cursor save/restore).

比較有趣的是裡面提到了 vttest 這套測試軟體可以測 terminal 的標準相容性,在 vttest 的官網上有提到可以測 VT100VT220VT520

Vttest tests the compatibility (demonstrates the non-compatibility) of so-called “VT100-compatible” terminals. In conformance of the good old hacker traditions, the only documentation of this program is the source code itself. To understand it, you also need a copy of the original VT100 manual from DEC.

Additional tests (past version 1.7) are provided for analysis of vt220 through vt520 terminals, as well as variants of xterm.

另外比較驚訝的是,terminal 下可以作到這樣的效果 (這邊看官方的截圖應該是 VT420?):

回到原來講標準相容性的問題,對於泡在 terminal 下的人來說超級重要,有工具可以測試幫助不少... vttest 這套程式在 Ubuntu 內可以直接裝來用:「Ubuntu – Package Search Results -- vttest」。

Terminal 的 Dark Theme

在「Automatic dark mode for terminal applications」這邊看到讓 terminal 的一些程式支援 Dark Theme 的方式,裡面引用的是「Automatic dark mode for terminal applications」這篇。

可以看到因為 terminal 下沒有標準,所以得 hack 事件發生時要送出的指令,文章裡面給出了 Vim (以及 Tmux)、Alacritty 這幾套程式的 hack。

不過這些 hack 過程算詳細 (而且有說明整個原理),如果有其他 terminal 下的程式有支援 Dark Theme 的話也可以用類似的邏輯套進去。

改變 Xfce Terminal 的 Alt-Number 快速鍵功能

前陣子桌機重裝 Ubuntu,順便把桌面環境換成 Xubuntu 用看看,也把本來再用的 GNOME Terminal 換成 XfceTerminal

我的習慣會把 GNOME Terminal 的 Alt-Number (像是 Alt-1) 快速鍵改掉,因為有不少程式會吃這組快速鍵,像是 tmux 切換視窗內玻璃 (pane) 排列的 preset 以及 IRC client 在不同頻道的切換。

但 Xfce Terminal 沒有 GUI 讓你改這組快速鍵 (其他的快速鍵有,但也雷雷的,後面會提到...),翻了翻看起來只有「Disable alt-n tab shortcut in xfce-terminal?」這邊有提到,算是堪用:

~/.config/xfce4/terminal/accels.scm looked promising but my changes were undone after a restart, so I made it read-only but it turns out commenting out the relevant lines makes no difference anyway.

雖然作者有提到它改了 ~/.config/xfce4/terminal/accels.scm 沒用,我自己發現這邊的確是很 buggy,但暫時還是可以找到 workaround。

解法是直接改沒錯,但不能直接註解掉,而需要改空,也就是本來的:

(gtk_accel_path "<Actions>/terminal-window/goto-tab-1" "<Alt>-1")

不能改成:

; (gtk_accel_path "<Actions>/terminal-window/goto-tab-1" "<Alt>-1")

而是要改空:

(gtk_accel_path "<Actions>/terminal-window/goto-tab-1" "")

另外要注意,透過 GUI 修改快速鍵後,~/.config/xfce4/terminal/accels.scm 裡面的內容也會被重製,也就是 Xfce Terminal 寫入這個檔案時是直接把預設值寫進去,而非把有效值寫進去:

這點算是比較地雷的地方...

Mutt 跳版推出 2.0

看到「Mutt 2.0 released」這篇,Mutt 推出 2.0 版,官方的 release notes 則是在這:「Mutt 2.0 Release Notes」。

這次版本跳到 2.0 主要是因為有 incompatible changes,實質上的變更其實沒有太多:

This release was bumped to 2.0, not because of the magnitude of features (which is actually smaller than past releases), but because of a few changes that are backward incompatible.

我自己還是保留一個信箱用 Mutt 在看信,主要是有一個信箱是完全控制在自己手上,所以自己架設 mail server 並且在上面看信...

上面主要是透過 procmail 拿來收各種信件 (尤其是 mailing list),對於純文字的閱讀還是頗方便...

讓 Python 輸出變豐富的 Rich

Hacker News 上看到的 Python 專案,讓 terminal 輸出變得更好看:「Rich is a Python library for rich text and beautiful formatting in the terminal.」。

看到當下吸引我的地方在於表格:

from rich.console import Console
from rich.table import Column, Table

console = Console()

table = Table(show_header=True, header_style="bold magenta")
table.add_column("Date", style="dim", width=12)
table.add_column("Title")
table.add_column("Production Budget", justify="right")
table.add_column("Box Office", justify="right")
table.add_row(
    "Dev 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118"
)
table.add_row(
    "May 25, 2018",
    "[red]Solo[/red]: A Star Wars Story",
    "$275,000,000",
    "$393,151,347",
)
table.add_row(
    "Dec 15, 2017",
    "Star Wars Ep. VIII: The Last Jedi",
    "$262,000,000",
    "[bold]$1,332,539,889[/bold]",
)

console.print(table)

輸出長這樣:

另外還有不少功能也不錯,會讓畫面豐富不少。

Google 搜尋無法使用 Lynx 或是 w3m 操作了

看到「No more google for console junkies」這篇,裡面提到了新版的 Google 沒辦法用 Lynx 操作了,拿 w3m 測了一下發現也不行了,可以搜到東西,但連結的操作已經是 JavaScript 化了,而這兩個瀏覽器都不支援 JavaScript,所以就卡住了...

是個從早年的 Unobtrusive JavaScript 概念,到現在沒有 JavaScript 就不會動的年代...

有翻到一些有支援 JavaScript 的 terminal web browser (LinksELinks),但都只是實驗品,連輸入中文都有問題... :/

可以用 IAM 控管的 AWS Instance Connect (透過 SSH 機制)

除了本來的 Systems Manager 可以在 EC2 的機器上開 shell 管理外,現在 AWS 推出了 EC2 Instance Connect,可以直接綁 IAM 的權限管理:「Introducing Amazon EC2 Instance Connect」。

With EC2 Instance Connect, you can control SSH access to your instances using AWS Identity and Access Management (IAM) policies as well as audit connection requests with AWS CloudTrail events. In addition, you can leverage your existing SSH keys or further enhance your security posture by generating one-time use SSH keys each time an authorized user connects. Instance Connect works with any SSH client, or you can easily connect to your instances from a new browser-based SSH experience in the EC2 console.

除了記錄外,也包含了一些安全機制,像是可以選擇一次性的帳號... 跟先前的 Systems Manager 比起來,主要是能用習慣的 terminal software 還是比較爽?

在 Terminal 看資料的 VisiData

在「VisiData」這篇看到的專案,專案的頁面在「A Swiss Army Chainsaw for Data」這邊,從 screenshot 可以看出來是 terminal 的檢視工具:

會注意到是因為支援 .xls

explore new datasets effortlessly, no matter the format: vd foo.json bar.csv baz.xls

SUPPORTED SOURCES 這邊可以看到完整的支援清單,居然連 pcap 也支援,不知道看起來如何 :o

在 Terminal 下的瀏覽器 Browsh

最近幾天看到「Browsh is a fully-modern text-based browser.」這個專案,在 terminal 下跑的瀏覽器,而且宣稱支援現代網頁的各種標準:

不過實際上後端是接 Firefox,並不是他自己處理所有的內容:

Browsh is available as a small (~2.5MB) static binary on all major platforms. The only dependency is a recent 57+ version of Firefox.

這樣還是超吃資源的,是個好玩為主的專案...