Skip to content

Comment on Show HN: Iterm-Mcp – AI Terminal/REPL Control for iTerm2

Comments

I’m about as likely to use this as buy a self-driving car at this point, but thought I’d point out that iTerm does know when the command has finished, thanks to its shell integration scripts, so does that help? Or if that’s not exposed, maybe just set the shell prompt to some distinctive value.

Hi, thanks for your comment! I haven't explored that approach. Can you say more? Will using the approach that you suggested support interactive CLI utilities like a REPL? Those are use cases that I definitely want to support with this project.

It’s just in response to “it's not always clear when the job is done”. With shell integration installed, iTerm knows how to separate commands and responses (you can cmd-shift-arrow to move between them, select the entire response with a click, etc.) so I thought it might expose that knowledge. It does that just by putting a distinctive character sequence in the shell prompt, and you could do that directly if needed. Other REPLs have customizable prompts too.

I wonder how much of what iTerm knows about the current terminal state is exposed. I got it working "good enough for me" and moved on to other pieces of the puzzle. I'm sure what I did could be improved upon quite a bit. I bet you're right that there's additional juice to squeeze out of whatever iTerm exposes.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.