{"version":"2.1.246","anchor":"plugins-can-ask-which-surface-they-are-running-on-and-read-f","canonical_anchor":"plugins-can-ask-which-surface-they-are-running-on-and-read-f","heading":"Plugins can ask which surface they are running on, and read flags","tier":"use","area":"Plugins","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246\/e\/plugins-can-ask-which-surface-they-are-running-on-and-read-f","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246","markdown":"### Plugins can ask which surface they are running on, and read flags\n\nPlugins can ask whether they run in the desktop app or terminal, and read feature flags.\n\n**What**\n\nTwo operations are new to the plugin host: one reports whether the request came from the desktop app or a terminal, and one reads a feature flag value. Separately, a plugin asking for the session's working directory or repository now gets the directory of the call that invoked it rather than the directory the process started in.\n\n**Details**\n\n- Neither of the two new operations exists in v2.1.245.\n- The cwd change matters for sessions that have moved directory mid-run, where the process cwd and the live session cwd differ.\n\n**Evidence**\n\n`\"session.surface\": { run: (t, n) => op.sessionSurface(n.plugin) }`\n\n- Area: Plugins\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 4\/5"}