From f368959fd8cb501996601993854dc8daa920c426 Mon Sep 17 00:00:00 2001 From: abose Date: Mon, 2 Mar 2026 20:34:38 +0530 Subject: [PATCH] fix: use outerWidth/outerHeight for Tauri new window dimensions Tauri's WebviewWindow constructor treats width/height as outer size, but innerWidth/innerHeight only gives the content area. This caused each File > New Window to shrink by the title bar and border size. Co-Authored-By: Claude Opus 4.6 --- docs/API-Reference/command/Commands.md | 6 ++++++ src/document/DocumentCommandHandlers.js | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/API-Reference/command/Commands.md b/docs/API-Reference/command/Commands.md index da355f0cf5..ff8af1b778 100644 --- a/docs/API-Reference/command/Commands.md +++ b/docs/API-Reference/command/Commands.md @@ -626,6 +626,12 @@ Shows current file in OS file explorer ## NAVIGATE\_OPEN\_IN\_TERMINAL Shows current file in OS Terminal +**Kind**: global variable + + +## NAVIGATE\_OPEN\_IN\_INTEGRATED\_TERMINAL +Opens integrated terminal at the selected file/folder path + **Kind**: global variable diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 387089dfed..ce325dd041 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1757,10 +1757,10 @@ define(function (require, exports, module) { } function newPhoenixWindow(cliArgsArray = null, cwd=null) { - // Electron needs outerWidth/outerHeight (includes window chrome). - // Tauri needs innerWidth/innerHeight. - let width = window.__ELECTRON__ ? window.outerWidth : window.innerWidth; - let height = window.__ELECTRON__ ? window.outerHeight : window.innerHeight; + // Both Electron and Tauri need outerWidth/outerHeight (includes window chrome) + // so the new window matches the current window's total size. + let width = (window.__ELECTRON__ || window.__TAURI__) ? window.outerWidth : window.innerWidth; + let height = (window.__ELECTRON__ || window.__TAURI__) ? window.outerHeight : window.innerHeight; Phoenix.app.openNewPhoenixEditorWindow(width, height, cliArgsArray, cwd); }