index rss mastodon twitter github linkedin email
Álvaro Ramírez
sponsor

Álvaro Ramírez

09 December 2024 An experimental (e)shell pager

These days, my LLM interactions primarily take place via chatgpt-shell's compose UX. I've grown fond of this hybrid style of interaction. On sharing the latest incarnation, jllw asked about the possibility to port to comint shells.

With jllw's great idea in mind, I set out to prototype an eshell pager, my preferred shell.

The initial results ain't too shabby:

shell-pager.gif

While you can easily flip through all eshell commands and outputs (via single-character n/p bindings), you can also compose and fire off new commands using a magit-style approach. That is, craft your desired command and C-c C-c to send it off.

The prototype is currently focused on eshell, but it can be easily ported to comint and other shells by writing new shell-maker configs:

(shell-pager--make-config
 :shell-buffer buffer
 :page-buffer (shell-pager--buffer)
 :next #'shell-pager--eshell-next
 :previous #'shell-pager--eshell-previous
 :current #'shell-pager--eshell-current-item
 :subscribe #'shell-pager--eshell-subscribe
 :unsubscribe #'shell-pager--eshell-unsubscribe
 :submit #'shell-pager--eshell-submit
 :interrupt #'shell-pager--eshell-interrupt)

shell-pager's super rough/experimental code is now on GitHub.

It's been a fun experiment so far. Time will tell, whether or not shell-pager can replace most of my eshell interactions. The good news is that this isn't an all or nothing sorta thing. shell-pager complements eshell, so I can always jump back to eshell itself and continue with the very same shell history.