Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconfigure how auto-type behaves when the window title is blank #11597

Open
1 task done
dridi opened this issue Dec 26, 2024 · 12 comments
Open
1 task done

Reconfigure how auto-type behaves when the window title is blank #11597

dridi opened this issue Dec 26, 2024 · 12 comments
Assignees
Milestone

Comments

@dridi
Copy link

dridi commented Dec 26, 2024

Have you searched for an existing issue?

  • Yes, I tried searching and reviewed the pinned issues

Brief Summary

Auto-type works in a terminal until some state change happens to the terminal. In my case I can observe this problem with vim. It happens with other ncurses-type applications, but not all of them (for example less is fine). If I open a new tab, I can perform auto-type with my global shortcut (Ctrl+Alt+A) just fine.

If I open vim in my terminal, I can still perform auto-type, but once I return to my terminal (exit vim or send SIGSTOP with Ctrl+Z) auto-type is broken. The shortcut will open the password prompt window, but once the database is unlocked, the auto-type prompt never appears.

This is as far as I have been able to narrow it down so far.

Steps to Reproduce

  1. vim
  2. Ctrl+Z
  3. Ctrl+Alt+A

Expected Versus Actual Behavior

No response

KeePassXC Debug Information

KeePassXC - Version 2.7.9
Revision: 8f6dd13

Qt 5.15.15
Debugging mode is disabled.

Operating system: Fedora Linux 41 (Xfce)
CPU architecture: x86_64
Kernel: linux 6.12.5-200.fc41.x86_64

Enabled extensions:
- Auto-Type
- Browser Integration
- Passkeys
- SSH Agent
- KeeShare
- YubiKey
- Secret Service Integration

Cryptographic libraries:
- Botan 2.19.5

Operating System

Linux

Linux Desktop Environment

XFCE

Linux Windowing System

X11

@droidmonkey
Copy link
Member

Does your terminal have a changing window title?

@dridi
Copy link
Author

dridi commented Dec 26, 2024

The window title appears to always be "Xfce4 Terminal" and when I open vim in a new functional tab, its title does not change by the time I leave vim and auto-type no longer works.

Reminder: when auto-type stops working, the window prompt for the database unlock still appears when I use my Ctrl+Alt+A shortcut.

@droidmonkey
Copy link
Member

I cannot replicate this at all.

2024-12-26_09-49-02.mp4

@dridi
Copy link
Author

dridi commented Dec 26, 2024

What additional information may I provide?

@dridi
Copy link
Author

dridi commented Dec 26, 2024

Thanks for the quick turnaround by the way.

@droidmonkey
Copy link
Member

So the facts I can tell from your report are:

  1. The auto-type global shortcut remains functional, evidenced by the unlock dialog continuing to appear
  2. Once the auto-type process starts this is what happens:
    a. Request unlock database if locked
    b. Once database is unlocked trigger auto-type process
    c. Search database for matching entries to window title
    d. Show select dialog if nothing matches or if multiple matches are found (always show if the setting is enabled)
    e. Execute auto-type after selecting a sequence. This may get interrupted if the window title changes or active window changes

So for the auto-type select dialog to not show up is a very peculiar problem. The fact that it seems to be related to post-vim running is even more peculiar.

@dridi
Copy link
Author

dridi commented Dec 26, 2024

In my case there will always be multiple matches. Ever since an input box appeared to filter the list of auto-types I made most of mine match '*' because I got tired of tweaking matches on a regular basis when login web pages change.

Another detail I didn't mention in my original report, this really applies to individual terminal tabs. Once I open a new tab I get auto-type working, but it remains defunct in tabs where it already broke.

Is there a way to collect debug logs I could compare between pre-vim and post-vim auto-type attempts?

@dridi
Copy link
Author

dridi commented Dec 26, 2024

This looks relevant:

--- xprop-pre-vim.txt
+++ xprop-post-vim.txt
@@ -1 +1 @@
-_NET_WM_ICON_GEOMETRY(CARDINAL) = 750, 1080, 0, 0
+_NET_WM_ICON_GEOMETRY(CARDINAL) = 870, 1080, 0, 0
@@ -282,4 +282,4 @@
-WM_ICON_NAME(STRING) = "Terminal"
+WM_ICON_NAME(STRING) = 
-_NET_WM_ICON_NAME(UTF8_STRING) = "Terminal"
+_NET_WM_ICON_NAME(UTF8_STRING) = 
-WM_NAME(STRING) = "Terminal"
+WM_NAME(STRING) = 
-_NET_WM_NAME(UTF8_STRING) = "Terminal"
+_NET_WM_NAME(UTF8_STRING) = 

Not idea why the geometry changed between xprop executions, I didn't resize the window. Not idea why "Terminal" disappeared from several properties after leaving vim.

@droidmonkey
Copy link
Member

droidmonkey commented Dec 26, 2024

We don't do debug logging (for better or worse). Having a window that cannot be targeted would also break the auto-type process between steps b and d above. The blank "WM_NAME" will cause auto-type to not function.

if (m_windowTitleForGlobal.isEmpty()) {
m_inGlobalAutoTypeDialog.unlock();
return;
}

@dridi
Copy link
Author

dridi commented Dec 26, 2024

Oh and I see it now. The title of the window was not "Xfce4 Terminal", this is the application name in the alt+tab window.

If the active tab is defunct, only "Xfce4 Terminal" appears when I hover the window via alt+tab, but on a working terminal tab I see both "Xfce4 Terminal" and "Terminal".

So now I need to understand why some ncurses applications clear the WM_NAME property of the terminal emulator. You had the root cause figured out in your very first comment!

@droidmonkey
Copy link
Member

😉 I've been around the block a couple times. I am going to retitle this because we should issue some form of warning or at least show the select dialog with all entries visible during this situation. I think that code above is left over from before we had a really good select dialog.

@droidmonkey droidmonkey self-assigned this Dec 26, 2024
@droidmonkey droidmonkey added this to the v2.7.10 milestone Dec 26, 2024
@github-project-automation github-project-automation bot moved this to To triage in WIP Tracker Dec 26, 2024
@droidmonkey droidmonkey changed the title Auto-type stops working in terminal after running vim Reconfigure how auto-type behaves when the window title is blank Dec 26, 2024
@droidmonkey droidmonkey moved this from To triage to In progress in WIP Tracker Dec 26, 2024
@dridi
Copy link
Author

dridi commented Dec 26, 2024

My workaround for the Xfce terminal is to change the setting "Dynamically-set title" to "Goes before initial title" to always have something in WM_NAME that satisfies auto-type (TitleMode=TERMINAL_TITLE_PREPEND in the terminalrc file, or the title-mode property in the xfce4-terminal.xml file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

2 participants