Fig Docs
  • 🏠Welcome to Fig
  • 👋Get Started
    • Download and Install
    • `fig home`
      • My Apps
      • The Sidebar
      • Settings
    • The Fig App Store
    • Hotkeys
  • 💪Autocomplete
  • 😀The Fig CLI
    • 1. Fig Overrides
    • 2. Fig Aliases
    • 3. $FIGPATH
    • 4. Fig Apps
  • 📖Interactive Runbooks
    • Form Elements
      • Input
      • Textarea
      • Dropdown
      • Checkboxes
      • Buttons
    • Templating & Interpolation
    • Scripting Language (Psilo)
      • Full List of Functions
    • Running Runbooks
    • Full Examples
  • ⚒️ Build your own CLI
    • `fig build`
    • .fig Files
  • 🧰Build your own App
    • Get Started
    • App Lifecycle
    • Key Concepts
      • Running Shell Commands
      • Reading Environment Variables
      • Accessing Files & Saving Data
      • Loading Local Resources
    • Window Managment
      • Setting Window Properties
      • Repositioning the Window
      • Focusing & Blurring the Window
    • Advanced
      • Creating a Pseudo-Terminal Session
  • Other
    • Fig for Teams
    • Security & Privacy
    • FAQ
    • Contact Us
  • Interactive Runbooks
Powered by GitBook
On this page
  1. Build your own App
  2. Window Managment

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)
PreviousRepositioning the WindowNextAdvanced

Last updated 4 years ago

🧰