This commit is contained in:
Jason R 2026-01-07 16:43:11 -08:00 committed by GitHub
commit 83ec860b55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -742,7 +742,7 @@ class FilenamePrompt(_BasePrompt):
if clicked:
path += os.sep
else:
elif path != "/":
# On Windows, when we have C:\foo and tab over .., we get C:\
path = path.rstrip(os.sep)

View File

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import os
from PyQt5.QtGui import QKeySequence
import pytest
from qutebrowser.qt.core import Qt
@ -113,3 +114,9 @@ class TestFileCompletion:
"""With / as path, show root contents."""
prompt = get_prompt('/')
assert prompt._file_model.rootPath() == '/'
def test_tab_root(self, get_prompt, qtbot):
prompt = get_prompt('/')
qtbot.keyPress(prompt._lineedit, Qt.Key_U, Qt.ControlModifier)
prompt.item_focus('next')
assert prompt._lineedit.text() == '/'