Compare commits

...
12 changed files with 106 additions and 55 deletions

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.24)
project(KSwitcher VERSION 0.6.101 LANGUAGES CXX RC)
project(KSwitcher VERSION 0.6.102 LANGUAGES CXX RC)
if(NOT WIN32)
message(FATAL_ERROR "KSwitcher uses native Windows APIs")
endif()
+4 -3
View File
@@ -88,9 +88,10 @@ Warning і початковий фокус на No.
скидаються. F2 також виконує цю дію.
- Ctrl+C копіює весь введений у командний рядок текст, навіть коли виділено
лише його частину.
- Ctrl+Insert копіює імена позначених файлів і папок активної панелі в порядку
відображення, по одному на рядок. Якщо позначок немає, копіюється ім’я під
курсором. Шляхи й рядок `..` пропускаються.
- Ctrl+Insert копіює весь текст непорожнього командного рядка. Якщо рядок
порожній, копіюються імена позначених файлів і папок активної панелі в
порядку відображення, по одному на рядок. Якщо позначок немає, копіюється
ім’я під курсором. Шляхи й рядок `..` пропускаються.
- Ctrl+E підставляє останню команду. Повторне натискання
підставляє старішу, доки не досягне початку історії. Alt+F8 відкриває історію
+6
View File
@@ -1,5 +1,11 @@
# Latest Windows release
## v0.6.102 — 2026-11-16
In KSwitcher Files, Ctrl+Insert copies the full command line when it contains text. With an empty command line, it copies names from the active pane. The LAN host returns Windows PowerShell startup errors without waiting for a system error dialog. Files explains DLL initialization failure `0xC0000142` and accepts another command. This release replaces v0.6.101.
**Українською.** У KSwitcher Files Ctrl+Insert копіює весь текст непорожнього командного рядка. Якщо рядок порожній, копіюються імена з активної панелі. ПК, який приймає LAN-команду, повертає помилки запуску Windows PowerShell без очікування системного діалогу. Files пояснює помилку ініціалізації DLL `0xC0000142` і знову приймає команди. Цей реліз замінює v0.6.101.
## v0.6.101 — 2026-11-16
In KSwitcher Files, Enter opens the selected item when the command line is empty, including when focus is in the terminal output. The Computers window places pairing and the monitor grid side by side so the bottom actions fit at high display scaling. This release replaces v0.6.100.
+1 -1
View File
@@ -1 +1 @@
b226b6956314530c4dfc68896ec385e06cb5a8f6709d9a555a6774efc8afed26 KSwitcher-win-x64.zip
8266fc87658ab708d556132ddc3b94d5628d650aac7971fa7c6570477088b609 KSwitcher-win-x64.zip
+38 -38
View File
@@ -1,165 +1,165 @@
{
"version": "0.6.102",
"schema": 1,
"version": "0.6.101",
"files": [
{
"path": "KSwitcher.exe",
"size": 2361856,
"sha256": "5ef419728079c2b45bbce6747ddbf6c8cbcf46134542613cdd22e81035b2c1d2"
"path": "KSwitcher.exe",
"sha256": "510957875f9934aedb0a859bbf3aa7bd2a45731d30978b616192072bbc979a3c"
},
{
"path": "KSwitcher.Config.exe",
"size": 2359296,
"sha256": "000cf951ebe18ff39b5521bbdbdf54176230b1dca5607fc97321aab4988fd26f"
"path": "KSwitcher.Config.exe",
"sha256": "b22888d853626fd39197385b1837f6cd5cb2137dbe3a6e2bd97fb5ad11f231c1"
},
{
"path": "KSwitcher.Screenshot.exe",
"size": 3337216,
"sha256": "2310e016dad617fd97303abd03a9a04c91737ff0b43386aa58241dc96f883043"
"path": "KSwitcher.Screenshot.exe",
"sha256": "265d7df3f99427b476842e70ed804069959d006fbf219ac2fce92d73f40d8ab3"
},
{
"path": "KSwitcher.Files.exe",
"size": 3739136,
"sha256": "be0b8b9097f8406bdd468f652be1659ec61de8ce29b543046d710cbc63c4a888"
"path": "KSwitcher.Files.exe",
"sha256": "d546e388a49a23b216286c2b58100f2cb15a408b46a56e72edeecb83da826a8d"
},
{
"path": "WebView2Loader.dll",
"size": 194912,
"path": "WebView2Loader.dll",
"sha256": "d3fce90bdeecb08596e377dea6a316354dd8949e32ff09b89d51be00c14e21b6"
},
{
"path": "terminal/addon-fit-LICENSE.txt",
"size": 1103,
"path": "terminal/addon-fit-LICENSE.txt",
"sha256": "e256f01188af527e4d06d21d06fbf785ae9c50d4b328bf03cbe0ba7f0aa4228f"
},
{
"path": "terminal/addon-fit.js",
"size": 1521,
"path": "terminal/addon-fit.js",
"sha256": "ba3ea256ce0620a0992a197d6c9baea64823fc93d8da07a9e366ca9943c18527"
},
{
"path": "terminal/index.html",
"size": 527,
"path": "terminal/index.html",
"sha256": "084d97a727b778fb10d31adcd557ee7840a38377ed60e0ef0f3ece93b349b1ef"
},
{
"path": "terminal/markdown-it-LICENSE.txt",
"size": 1073,
"path": "terminal/markdown-it-LICENSE.txt",
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473"
},
{
"path": "terminal/markdown-it.js",
"size": 100786,
"path": "terminal/markdown-it.js",
"sha256": "391f2aa638e75e6c7859d0a5c5650ef0956722a45998f17e05b83bc655778e1e"
},
{
"path": "terminal/markdown.html",
"size": 2171,
"path": "terminal/markdown.html",
"sha256": "b011e0872c869c48302a37b3e2e462addc1ee11e723f840ad7df1e893fc15336"
},
{
"path": "terminal/markdown.js",
"size": 6381,
"path": "terminal/markdown.js",
"sha256": "21cc15ceb2b8bee9b3f6a816d629677dab61243daf784c10b4c96312729cb149"
},
{
"path": "terminal/mermaid-LICENSE.txt",
"size": 1089,
"path": "terminal/mermaid-LICENSE.txt",
"sha256": "ec9fb67dcb25eccc416ed56e1aab819222c805a2a4bfe4cb19e7556bf2ffde80"
},
{
"path": "terminal/mermaid.js",
"size": 5537838,
"path": "terminal/mermaid.js",
"sha256": "336df803d87a38b70a01e736e666c8f7601d2ce42f5e47c8fafe5d721074b9a3"
},
{
"size": 4851,
"path": "terminal/terminal.js",
"size": 4835,
"sha256": "27a8b3b7fd6e0797363a5241f8871e674d01293d53a7b21bd71dfae47aea4eec"
"sha256": "bd8413020862860c59a5aac7a2c09ad754ba046e13e0eea436c962daca9fdffc"
},
{
"path": "terminal/xterm-LICENSE.txt",
"size": 1261,
"path": "terminal/xterm-LICENSE.txt",
"sha256": "b569f629d00f2626a8100df2a1798210535621e42164dfd426a6fe5aac7b0ccd"
},
{
"path": "terminal/xterm.css",
"size": 7112,
"path": "terminal/xterm.css",
"sha256": "854a7c0fb70e8b1a083c16797ab827299fb18744f5ad34f227b48337e33293c6"
},
{
"path": "terminal/xterm.js",
"size": 488663,
"path": "terminal/xterm.js",
"sha256": "14903579ff54664cd72f8e8699e6961a6272c21863ec1c3b118cdc8af5d4a972"
},
{
"path": "LICENSE",
"size": 4401,
"path": "LICENSE",
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c"
},
{
"path": "json-LICENSE.txt",
"size": 1075,
"path": "json-LICENSE.txt",
"sha256": "c0d068392ea65358b798b8c165103560f06e9e3b38c4ab4e2d8810a7b931af86"
},
{
"path": "files-text-license.txt",
"size": 883,
"path": "files-text-license.txt",
"sha256": "185c5a37521316e940ead89cbf0b1ba5862d810c7c966e6c6a14a4a515b23625"
},
{
"path": "README.md",
"size": 94357,
"path": "README.md",
"sha256": "fca41227e9b38bf061298d69806ea66fb00086ae03aec49665e4f68ed2c3f8e9"
},
{
"path": "LAN-PREVIEW.md",
"size": 11577,
"path": "LAN-PREVIEW.md",
"sha256": "1233d6a0ed76564dd034f178a9f65db076244a819137f74dc9f2c27df9d3c930"
},
{
"path": "dictionaries/en.txt",
"size": 682867,
"path": "dictionaries/en.txt",
"sha256": "5f267c141c3d6837870e1c098f86b89a113ba300343119432644ead88f720c21"
},
{
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt",
"size": 20138,
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt",
"sha256": "28a9529c7d0bb4dc51f4bf5c116a3d16ef247a052f7591466768ddf563fd1cf5"
},
{
"path": "dictionaries/README.md",
"size": 2265,
"path": "dictionaries/README.md",
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311"
},
{
"path": "dictionaries/ru.txt",
"size": 1060364,
"path": "dictionaries/ru.txt",
"sha256": "9ef922c7699569304a428f6aba0fd13a21341c0d0cb9561f37ef83c41577a28b"
},
{
"path": "dictionaries/sources.json",
"size": 1280,
"path": "dictionaries/sources.json",
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408"
},
{
"path": "dictionaries/uk.txt",
"size": 940799,
"path": "dictionaries/uk.txt",
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf"
},
{
"path": "tools/README.txt",
"size": 993,
"path": "tools/README.txt",
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a"
},
{
"path": "tools/StayHere.exe",
"size": 134656,
"path": "tools/StayHere.exe",
"sha256": "6ef5cf64708d62b7fc63c3c793cc99188a513433ff4774cae01dc014f6664376"
},
{
"path": "tools/StayHere-README.md",
"size": 2796,
"path": "tools/StayHere-README.md",
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413"
}
]
+3 -3
View File
@@ -9,8 +9,8 @@ IDC_SCREENSHOT_PENCIL CURSOR "icons/lucide/pencil.cur"
1 RT_MANIFEST "app.manifest"
201 RCDATA "update.ps1"
1 VERSIONINFO
FILEVERSION 0,6,101,0
PRODUCTVERSION 0,6,101,0
FILEVERSION 0,6,102,0
PRODUCTVERSION 0,6,102,0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
@@ -20,7 +20,7 @@ BEGIN
BEGIN
VALUE "FileDescription", "KSwitcher — native keyboard and clipboard utility"
VALUE "ProductName", "KSwitcher"
VALUE "FileVersion", "0.6.101"
VALUE "FileVersion", "0.6.102"
END
END
BLOCK "VarFileInfo"
+1 -1
View File
@@ -67,7 +67,7 @@ terminal.attachCustomKeyEventHandler(event => {
if (!event.repeat) bridge.postMessage('insert-name');
}
else if (event.key === 'Insert') {
if (!event.repeat) bridge.postMessage('copy-panel-names');
if (!event.repeat) bridge.postMessage('copy-command-line-or-panel-names');
}
else if (event.code === 'KeyR') {
if (!event.repeat) bridge.postMessage('refresh-panel');
+12 -3
View File
@@ -1014,6 +1014,12 @@ void copyPanelNames(HWND owner)
catch(const std::exception &) { setStatus(L"Could not copy file names."); }
}
void copyCommandLineOrPanelNames(HWND owner)
{
if(GetWindowTextLengthW(terminalInput)) copyTerminalInput(owner);
else copyPanelNames(owner);
}
void refreshPanel(Panel &panel)
{
panel.folderSizeStop.request_stop();
@@ -1105,7 +1111,7 @@ bool ensureTerminalView(HWND owner)
else if(message==L"insert-path") insertCurrentPanelPath();
else if(message==L"insert-name") insertCurrentPanelPath(true);
else if(message==L"copy-command-line") SendMessageW(terminalInput,WM_COPY,0,0);
else if(message==L"copy-panel-names") copyPanelNames(owner);
else if(message==L"copy-command-line-or-panel-names") copyCommandLineOrPanelNames(owner);
else if(message==L"refresh-panel") refreshPanel(panels[active]);
else if(message==L"toggle") showTerminal(owner,!terminalVisible);
else if(!terminalVisible && (message==L"grow" || message==L"shrink"))
@@ -1210,7 +1216,10 @@ bool submitTerminalCommand(const Panel &panel,const std::wstring &value)
{
FilesConnection host(&peer);
const auto code=ks::lan::runRemoteCommand(host,directory,value,appendRemoteOutput,stop);
appendRemoteOutput("\r\n[Remote exit code "+std::to_string(code)+"]\r\n");
if(code==STATUS_DLL_INIT_FAILED)
appendRemoteOutput("\r\nRemote PowerShell could not start: DLL initialization failed (0xC0000142).\r\n");
else
appendRemoteOutput("\r\n[Remote exit code "+std::to_string(code)+"]\r\n");
}
catch(const std::system_error &error)
{
@@ -5643,7 +5652,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int show)
if(message.wParam=='F') insertCurrentPanelPath();
else if(message.wParam=='R') refreshPanel(panels[active]);
else if(message.wParam==VK_RETURN) insertCurrentPanelPath(true);
else if(message.wParam==VK_INSERT) copyPanelNames(window);
else if(message.wParam==VK_INSERT) copyCommandLineOrPanelNames(window);
else SendMessageW(terminalInput,WM_COPY,0,0);
}
continue;
+2
View File
@@ -38,6 +38,8 @@ bool shouldElevateOnLaunch()
int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int)
{
// Inherited by unattended children such as the LAN PowerShell process.
SetErrorMode(GetErrorMode() | SEM_FAILCRITICALERRORS);
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
int argc{};
auto argv = CommandLineToArgvW(GetCommandLineW(), &argc);
+1 -1
View File
@@ -2,7 +2,7 @@
#include "platform.h"
namespace ks
{
inline constexpr wchar_t AppVersion[] = L"0.6.101";
inline constexpr wchar_t AppVersion[] = L"0.6.102";
inline constexpr UINT UpdateMessage = WM_APP + 7;
inline constexpr UINT UpdateCheckIntervalMs = 6 * 60 * 60 * 1000;
inline constexpr UINT UpdateNotificationRetryMs = 5 * 60 * 1000;
+29
View File
@@ -296,6 +296,35 @@ try {
}
Write-Output 'Verified Enter from the terminal WebView runs the command exactly once.'
Select-Row $left '[Test folder]'
Add-Type -AssemblyName System.Windows.Forms
$savedClipboard = [Windows.Forms.Clipboard]::GetDataObject()
try {
$nativeDraft = "Get-Item -LiteralPath '$leftDir'"
[void][FilesActivationUi]::Write($inputBox,0x0C,[IntPtr]::Zero,$nativeDraft)
[void][FilesActivationUi]::Send($inputBox,0xB1,[IntPtr]0,[IntPtr]4)
$keys.SendKeys('^{INSERT}')
Wait-Until 'Ctrl+Insert copying the full command line with a partial selection' {
[Windows.Forms.Clipboard]::GetText() -ceq $nativeDraft
}
$webviewDraft = "Get-Item -LiteralPath '$rightDir'"
[void][FilesActivationUi]::Write($inputBox,0x0C,[IntPtr]::Zero,$webviewDraft)
& $Node (Join-Path $PSScriptRoot 'files_markdown_browser.mjs') $port 'terminal-copy'
if($LASTEXITCODE){throw 'Could not send Ctrl+Insert through the terminal WebView.'}
Wait-Until 'Ctrl+Insert copying the command line with focus in the terminal WebView' {
[Windows.Forms.Clipboard]::GetText() -ceq $webviewDraft
}
[void][FilesActivationUi]::Write($inputBox,0x0C,[IntPtr]::Zero,'')
$keys.SendKeys('^{INSERT}')
Wait-Until 'Ctrl+Insert copying the selected folder name when the command line is empty' {
[Windows.Forms.Clipboard]::GetText() -ceq 'Test folder'
}
} finally {
if ([Windows.Forms.Clipboard]::GetText() -cin @($nativeDraft,$webviewDraft,'Test folder')) {
if ($savedClipboard) { [Windows.Forms.Clipboard]::SetDataObject($savedClipboard,$true) }
else { [Windows.Forms.Clipboard]::Clear() }
}
}
Write-Output 'Verified Ctrl+Insert copies the command line first and falls back to the selected item.'
& $Node (Join-Path $PSScriptRoot 'files_markdown_browser.mjs') $port 'terminal-enter'
if($LASTEXITCODE){throw 'Could not send Enter through the terminal WebView.'}
Wait-Until 'Enter from the terminal opening the selected folder in the pane' {
+8 -4
View File
@@ -3,6 +3,7 @@ import { writeFile } from 'node:fs/promises';
import { setTimeout as delay } from 'node:timers/promises';
const [port, scenario, artifact, title] = process.argv.slice(2);
const terminalKey = scenario === 'terminal-enter' || scenario === 'terminal-copy';
let socket;
const pending = new Map();
let sequence = 0;
@@ -41,7 +42,7 @@ async function evaluate(expression) {
const target = await waitFor(async () => {
const response = await fetch('http://127.0.0.1:' + port + '/json/list').catch(() => null);
if (!response?.ok) return;
const url = scenario === 'terminal-enter'
const url = terminalKey
? 'https://kswitcher-terminal.invalid/index.html'
: 'https://kswitcher-markdown.invalid/markdown.html';
return (await response.json()).find(item => item.url === url &&
@@ -62,10 +63,13 @@ await new Promise((resolve, reject) => {
});
try {
if (scenario === 'terminal-enter') {
if (terminalKey) {
await evaluate('document.querySelector(".xterm-helper-textarea").focus()');
await command('Input.dispatchKeyEvent', { type:'keyDown', key:'Enter', code:'Enter', windowsVirtualKeyCode:13 });
await command('Input.dispatchKeyEvent', { type:'keyUp', key:'Enter', code:'Enter', windowsVirtualKeyCode:13 });
const key = scenario === 'terminal-copy'
? { key:'Insert', code:'Insert', modifiers:2, windowsVirtualKeyCode:45 }
: { key:'Enter', code:'Enter', windowsVirtualKeyCode:13 };
await command('Input.dispatchKeyEvent', { type:'keyDown', ...key });
await command('Input.dispatchKeyEvent', { type:'keyUp', ...key });
} else if (scenario === 'render') {
await waitFor(() => evaluate(`document.documentElement?.classList.contains('rendered') &&
!!document.querySelector('figure svg') &&