summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Boyd Isacsson <nicholas@isacsson.se>2021-09-10 15:49:44 +0200
committerNicholas Boyd Isacsson <nicholas@isacsson.se>2021-09-10 15:49:44 +0200
commitdaecf903a40473e5e8ec3c7dcb495654c2829ac2 (patch)
tree05830113f44b17b73f481c01d87546b2e12817ce
parent9a8d37216cfae75f7c45a1cbbe185485dc6934c4 (diff)
downloadqutebrowser-daecf903a40473e5e8ec3c7dcb495654c2829ac2.tar.gz
qutebrowser-daecf903a40473e5e8ec3c7dcb495654c2829ac2.zip
Add --private flag to :tab-clone
-rw-r--r--qutebrowser/browser/commands.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py
index 8cd73ae4f..ff70df1f3 100644
--- a/qutebrowser/browser/commands.py
+++ b/qutebrowser/browser/commands.py
@@ -383,17 +383,18 @@ class CommandDispatcher:
yield parsed
@cmdutils.register(instance='command-dispatcher', scope='window')
- def tab_clone(self, bg=False, window=False):
+ def tab_clone(self, bg=False, window=False, private=False):
"""Duplicate the current tab.
Args:
bg: Open in a background tab.
window: Open in a new window.
+ private: If the tab should be detached into a private instance.
Return:
The new QWebView.
"""
- cmdutils.check_exclusive((bg, window), 'bw')
+ cmdutils.check_exclusive((bg, window, private), 'bwp')
curtab = self._current_widget()
cur_title = self._tabbed_browser.widget.page_title(
self._current_index())
@@ -404,9 +405,9 @@ class CommandDispatcher:
# The new tab could be in a new tabbed_browser (e.g. because of
# tabs.tabs_are_windows being set)
- if window:
+ if window or private:
new_tabbed_browser = self._new_tabbed_browser(
- private=self._tabbed_browser.is_private)
+ private=self._tabbed_browser.is_private or private)
else:
new_tabbed_browser = self._tabbed_browser
newtab = new_tabbed_browser.tabopen(background=bg)