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.

fig.run('whoami')
setTimeout(() => {
  fig.focus()
}, 500)

Last updated