Skip to content

/timestamps command has no visible effect and /exit missing from autocomplete #26625

Closed as not planned

Description

@welbonwang

Description

Bug Report

Description

The /timestamps slash command (and its alias /toggle-timestamps) is supposed to show a timestamp below each user message in the TUI session view. While the command correctly toggles between "Show timestamps" and "Hide timestamps" state (persisted via KV store), the timestamps are not visually rendered in any theme.

Steps to Reproduce

  1. Start OpenCode TUI (v1.14.42+)
  2. Have a conversation with at least one user message
  3. Type /timestamps in the prompt — the command title reads "Show timestamps"
  4. Select it to toggle timestamps ON
  5. Observe: no timestamp appears under any user message bubble
  6. Run /timestamps again — title now reads "Hide timestamps", confirming the toggle state changed

Expected Behavior

When timestamps are enabled, each user message bubble should display a creation time (e.g. 14:32 or 14:32 · 2026-05-10) at the bottom, rendered in theme.textMuted.

Actual Behavior

No visible timestamp text appears under user messages in any theme (tested with multiple built-in themes via /themes).

Environment

Root Cause Analysis

The rendering code at packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1361-1376:

<Show
  when={queued()}
  fallback={
    <Show when={ctx.showTimestamps()}>
      <text fg={theme.textMuted}>
        <span style={{ fg: theme.textMuted }}>
          {Locale.todayTimeOrDateTime(props.message.time.created)}
        </span>
      </text>
    </Show>
  }
>

The toggle logic itself is correct:

  • KV signal defaults to "hide" (line 218)
  • Toggle switches between "hide" / "show" (line 681)
  • showTimestamps memo derives boolean state (line 233)

The likely issue is a layout/rendering problem: the timestamp <text> element is the last child inside a <box> with paddingBottom={1} (line 1336). In OpenTUI's flex layout, this trailing <text> without an explicit wrapping <box> may collapse into the bottom padding area, rendering it invisible. The <text> element may need to be wrapped in its own <box> or the padding structure needs adjustment.

Related: /exit command also affected by the same commit

The same commit (98f5e6e71) also introduced an enabled guard on the /exit slash command (app.tsx:651-655) that makes it unreachable in the autocomplete dropdown whenever the prompt input has text:

enabled: () => {
  const current = promptRef.current
  if (!current?.focused) return true
  return current.current.input === ""
},

Since typing / to open the autocomplete means the prompt is focused and contains text, the enabled check returns false and /exit is filtered out of the slash command list. This appears to be an unintended side effect — the guard was likely intended to prevent accidental exits during typing, but it also prevents the slash command from appearing in autocomplete.

Plugins

No response

OpenCode version

1.14.42+

Steps to reproduce

  1. Start OpenCode TUI (v1.14.42+)
  2. Have a conversation with at least one user message
  3. Type /timestamps in the prompt — the command title reads "Show timestamps"
  4. Select it to toggle timestamps ON
  5. Observe: no timestamp appears under any user message bubble
  6. Run /timestamps again — title now reads "Hide timestamps", confirming the toggle state changed

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

ssh to Ubuntu at Windows Terminal

Activity

  1. github-actions commented on May 10, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The /timestamps rendering bug appears to be unique to this report.

  2. kommander commented on May 11, 2026

    @kommander
    Contributor

    The /exit command should be back in v1.14.47, and I cannot reproduce the /timestamps not working in the latest version anymore either.

  3. welbonwang commented on May 11, 2026

    @welbonwang
    Author

    the following image is what I start OpenCode:
    Image

    the following image showes when I type slash command /timestamps
    Image

    the following image showes when I finish slash command /timestamps
    Image

    There is nothing changed.

  4. kommander commented on May 15, 2026

    @kommander
    Contributor

    Does this issue persist without any plugins? Try running with opencode --pure, if the issue does not persist it is likely an issue with the plugin. In that case please file an issue with the plugin.

  5. guysoft commented on May 27, 2026

    @guysoft

    Hey, i have a PR that fixes this, and adds gutter support, it will go stale and removed if it gets no reactions, so your comments or emojis there would be appreciated! #29398

  6. kommander commented on May 27, 2026

    @kommander
    Contributor

    The two original bugs from this issue are not reproducible anymore. So the gutter PR is a new/different issue?

  7. guysoft commented on May 28, 2026

    @guysoft

    @kommander ah, i thought it did solve it becaus it worked on my branch, but not on stable.

    Just to be clear: /timestamps on my current stable shows no timestamps. In my branch it does (see screenshot in pr). I didnt see /toggle-timestamps this issue talks about. I see that /timeatamps does that, but only in my branch.

    How were you unable to reproduce it?

  8. guysoft commented on May 30, 2026

    @guysoft

    The PR is a new feature (gutter mode) rather than a fix to the original reports here. Sorry for the noise on this thread.

  9. github-actions commented on Aug 2, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions