---
url: /matchers/to-have-cursor-hidden.md
description: Assert that the terminal cursor is hidden
---

# toHaveCursorHidden

::: warning Deprecated
Prefer [toHaveCursor](/matchers/to-have-cursor) which checks multiple cursor properties at once:

```typescript
expect(term).toHaveCursor({ visible: false })
```

:::

Assert that the terminal cursor is hidden.

## Signature

```typescript
expect(term).toHaveCursorHidden(options?: { timeout?: number })
```

## Parameters

| Parameter         | Type     | Description                                 |
| ----------------- | -------- | ------------------------------------------- |
| `options.timeout` | `number` | Auto-retry timeout in ms (Playwright-style) |

## Usage

```typescript
// Assert cursor is hidden (e.g., after DECTCEM hide)
expect(term).toHaveCursorHidden()

// With auto-retry
await expect(term).toHaveCursorHidden({ timeout: 5000 })

// Negation
expect(term).not.toHaveCursorHidden()
```

## Accepts

| Target            | Supported |
| ----------------- | --------- |
| `term` (Terminal) | Yes       |
| `term.screen`     | No        |
| `term.cell(r, c)` | No        |

## Notes

* TUI applications typically hide the cursor during rendering and show it at the input position

## See Also

* [toHaveCursor](/matchers/to-have-cursor) - composable cursor matcher (preferred)
* [toHaveCursorVisible](/matchers/to-have-cursor-visible) - assert cursor is visible
* [toHaveCursorAt](/matchers/to-have-cursor-at) - cursor position
