# Focusing & Blurring the Window

**Focus**

`fig.focus()` — takes focus away from the terminal and gives it to your app. When the user types, their input will be directed to your app.

**Blur**

`fig.blur()` — returns focus to the terminal window. When the user types, their input will go to shell.

> Note: `fig.run` and `fig.insert` are sensitive to changes to app focus. If you need to use one of them and then change window focus using `fig.blur()` or `fig.focus()`, make sure to delay by at least 500 milliseconds.
>
> ```javascript
> fig.run('whoami')
> setTimeout(() => {
>   fig.focus()
> }, 500)
> ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fig.gitbook.io/fig/apps/window-managment/focusing-and-blurring-the-window.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
