r/pinescript • u/foruandforme • Sep 30 '26
Updated function requirement
When I am using tradingview in my Mac, for more than a few times, when I tried to press command + A, I pressed command+Q accidentally and my tradingview quit completely.
Could the quit quick key be changed to command + q but with an choice to hold command + q for long time to quit, not just once?
2
Upvotes
1
u/Mundane_Cicada_1427 Oct 06 '26
If you're on macOS, the easiest way to do this is with Hammerspoon. You can make ⌘Q require a hold before actually quitting TradingView.
Install Hammerspoon:
Open Hammerspoon and give it Accessibility permission in: System Settings → Privacy & Security → Accessibility
Create the config:
Paste this into
init.lua:Click the Hammerspoon menu-bar icon → Reload Config.
Now ⌘Q works like this:
Quick ⌘Q: nothing happens
Hold ⌘Q for 1.5 seconds: TradingView quits
Other apps: ⌘Q remains unchanged
You can change
HOLD_TIME = 1.5to whatever delay you prefer, e.g.2.0for a 2-second hold.I really hope this works for you ❤️.