Remocode
Telegram Remote4 min read

The Peek Command: Check for Unsubmitted Terminal Input

Learn how Remocode's peek command lets you check whether there is leftover unsubmitted input in your terminal. Essential for debugging when commands were not submitted properly.

peekterminal-inputdebuggingtelegramcommandsremocode

What the Peek Command Does

The peek command checks your terminal for leftover unsubmitted input. When you send text to a terminal through Telegram, it gets typed into the terminal input buffer. Normally, an Enter keypress follows to submit it. But sometimes the Enter does not register, the application is not ready to receive input, or the timing is off. The result: your text sits in the terminal input buffer, unsent and invisible to the running application.

peek reveals this hidden state.

When to Use Peek

The most common scenario is when you send a command or response via Telegram and nothing seems to happen. The AI agent does not react, the terminal does not produce new output, and you are left wondering whether your input was received.

Before retyping your command (which could result in duplicate or garbled input), send:

peek

If you are in via mode, use the escape prefix:

!peek

Remocode will examine the terminal's input buffer and report back. If there is text sitting there waiting to be submitted, you will see it in the response.

What to Do With the Results

If peek shows your text is there: The input was typed but not submitted. Send submit (or enter) to push an Enter keypress to the terminal and submit the waiting input.

If peek shows nothing: Your input either was already submitted (and the agent is processing it) or it was lost. In this case, you can safely retype your command.

Why Input Gets Stuck

Several situations can cause unsubmitted input:

Ink app timing — Claude Code, Gemini CLI, and OpenAI Codex use the Ink framework for their terminal UI. These apps have moments where they are redrawing the interface and not listening for input. If your text arrives during one of these moments, it may be buffered but the Enter keypress might be consumed by the UI redraw.

Network latency — When sending from Telegram, there is inherent network latency. The text and the Enter keypress are sent as separate events. If there is a gap, the application state might change between receiving the text and receiving the Enter.

Concurrent output — If the terminal is actively producing output while you send input, the input can be interleaved with output in unexpected ways.

Peek and the Retry System

Remocode's smart typing for Ink apps includes a retry system that sends Enter again at 8, 18, and 28 seconds if no output is detected. Peek is most useful after this retry window has passed — roughly 30 seconds after your initial input. If the retries did not work and peek shows text in the buffer, there may be a deeper issue with the application's input handling.

Peek in Practice

A typical debugging sequence:

  • You send "yes" via via mode to approve a Claude Code action.
  • After 10 seconds, nothing happens. The retry system has not triggered output yet.
  • After 30 seconds, still nothing. You use !peek.
  • Peek reports "yes" is in the input buffer.
  • You send !submit to push Enter.
  • Claude Code receives the input and continues.

Without peek, you might have typed "yes" again, resulting in "yesyes" in the buffer, which would confuse Claude Code.

Summary

Peek is a diagnostic command, not one you use frequently. But when you need it, it prevents the frustrating cycle of guessing whether your input was received. Think of it as checking whether a letter is still in the mailbox before sending a duplicate.

Ready to try Remocode?

Start with a 7-day Pro trial — no credit card required. Download now and start coding with AI from anywhere.

Download Remocodefor macOS

Related Articles