From e32b9093545e7719bd91d8e219bb30aabd688230 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 13 Mar 2026 01:10:09 -0700 Subject: [PATCH] core: add disable env vars for file watcher and crash handler --- changelog/next.md | 2 ++ src/core/qmlglobal.cpp | 4 +++- src/launch/launch.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog/next.md b/changelog/next.md index 4883c93..fa6d845 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -34,6 +34,8 @@ set shell id. - PwNodeLinkTracker ignores sound level monitoring programs. - Replaced breakpad with cpptrace. - Reloads are prevented if no file content has changed. +- Added `QS_DISABLE_FILE_WATCHER` environment variable to disable file watching. +- Added `QS_DISABLE_CRASH_HANDLER` environment variable to disable crash handling. ## Bug Fixes diff --git a/src/core/qmlglobal.cpp b/src/core/qmlglobal.cpp index 6c26609..35504f6 100644 --- a/src/core/qmlglobal.cpp +++ b/src/core/qmlglobal.cpp @@ -60,7 +60,9 @@ void QuickshellSettings::setWorkingDirectory(QString workingDirectory) { // NOLI emit this->workingDirectoryChanged(); } -bool QuickshellSettings::watchFiles() const { return this->mWatchFiles; } +bool QuickshellSettings::watchFiles() const { + return this->mWatchFiles && qEnvironmentVariableIsEmpty("QS_DISABLE_FILE_WATCHER"); +} void QuickshellSettings::setWatchFiles(bool watchFiles) { if (watchFiles == this->mWatchFiles) return; diff --git a/src/launch/launch.cpp b/src/launch/launch.cpp index ee7ca64..3a9a2a5 100644 --- a/src/launch/launch.cpp +++ b/src/launch/launch.cpp @@ -138,9 +138,11 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio }; #if CRASH_HANDLER - crash::CrashHandler::init(); + if (qEnvironmentVariableIsSet("QS_DISABLE_CRASH_HANDLER")) { + qInfo() << "Crash handling disabled."; + } else { + crash::CrashHandler::init(); - { auto* log = LogManager::instance(); crash::CrashHandler::setRelaunchInfo({ .instance = InstanceInfo::CURRENT,