Skip to content

Drop down mode - #673

Draft
timbz wants to merge 1 commit into
pop-os:masterfrom
timbz:master
Draft

Drop down mode#673
timbz wants to merge 1 commit into
pop-os:masterfrom
timbz:master

Conversation

@timbz

@timbz timbz commented Dec 29, 2025

Copy link
Copy Markdown

This PR adds a drop-down mode, similar to terminals like Guake or Tilda. This feature is substantial to my workflow and I thought others might find it useful as well.

To use it, create a custom shortcut in COSMIC Settings with the command cosmic-term --drop-down .
The first invocation launches the drop-down terminal, subsequent calls toggle it show/hide. Only one instance runs at a time.

I'm still learning Rust, so please be gentle with feedback. I'd love to hear if this is something you'd be interested in merging, or if you'd prefer a different approach for this functionality. Happy to iterate on any suggestions for improvement!

@dickwall

Copy link
Copy Markdown

Hang in there @timbz - the lack of a decent drop down terminal is one of the things preventing me switching my main development machine to cosmic, and I'm hopeful this will be accepted or at least spur development in this missing feature. It's discouraging to see that there has been no acknowledgement from the devs though :-(

rnbwdsh added a commit to rnbwdsh/cosmic-term that referenced this pull request Jul 22, 2026
…d behavior if not used

Behavior on first launch: create a surface, add a signal handler, render the terminal into that overlay surface
Behavior on later launches: find the process that was launched with "--drop-down" and send a signal to it (currently via spawning a process)
Handle USR1 signals for toggling dropdown
Custom right click context menu in dropdown mode, as maximizing makes no sense
Added setting: A secondary show-headers-dropdown that's only visible in drop down mode
Added setting: The height of the dropdown in px, I'd like to do relative but to my understanding wayland doesn't trivially allow that
Bug byepass in iced: When creating the overlay without any delay, the window is transparent but not "frosted"

This is hugely based on pop-os#673 and just rebased and refactored, as various menu things were broken for me.

I think this MR is relevant, because people are already vibe coding a non-working version of this: https://github.com/M0Rf30/cosmic-ext-quake-terminal

This was partially created with the help of AI.
rnbwdsh added a commit to rnbwdsh/cosmic-term that referenced this pull request Jul 22, 2026
…d behavior if not used

Behavior on first launch: create a surface, add a signal handler, render the terminal into that overlay surface
Behavior on later launches: find the process that was launched with "--drop-down" and send a signal to it (currently via spawning a process)
Handle USR1 signals for toggling dropdown
Custom right click context menu in dropdown mode, as maximizing makes no sense
Added setting: A secondary show-headers-dropdown that's only visible in drop down mode
Added setting: The height of the dropdown in px, I'd like to do relative but to my understanding wayland doesn't trivially allow that
Bug byepass in iced: When creating the overlay without any delay, the window is transparent but not "frosted"

This is hugely based on pop-os#673 and just rebased and refactored, as various menu things were broken for me.

I think this MR is relevant, because people are already vibe coding a non-working version of this: https://github.com/M0Rf30/cosmic-ext-quake-terminal

This was partially created with the help of AI.
@rnbwdsh rnbwdsh mentioned this pull request Jul 22, 2026
5 tasks
rnbwdsh added a commit to rnbwdsh/cosmic-term that referenced this pull request Jul 22, 2026
…d behavior if not used

Behavior on first launch: create a surface, add a signal handler, render the terminal into that overlay surface
Behavior on later launches: find the process that was launched with "--drop-down" and send a signal to it (currently via spawning a process)
Handle USR1 signals for toggling dropdown
Custom right click context menu in dropdown mode, as maximizing makes no sense
Added setting: A secondary show-headers-dropdown that's only visible in drop down mode
Added setting: The height of the dropdown in px, I'd like to do relative but to my understanding wayland doesn't trivially allow that
Bug byepass in iced: When creating the overlay without any delay, the window is transparent but not "frosted"

This is hugely based on pop-os#673 and just rebased and refactored, as various menu things were broken for me.

I think this MR is relevant, because people are already vibe coding a non-working version of this: https://github.com/M0Rf30/cosmic-ext-quake-terminal

This was partially created with the help of AI.
@rnbwdsh

rnbwdsh commented Jul 22, 2026

Copy link
Copy Markdown

i rebased and refactored this, i'd be happy for any feedback, especially on the comments I put there

@asilenkov

Copy link
Copy Markdown

i rebased and refactored this, i'd be happy for any feedback, especially on the comments I put there

Hello! I've tried this on Fedora 44, works for me, thanks for your efforts.
There is one small glitch,

Bug in find_existing_dropdown_pid – single-instance toggle always fails
src/dropdown.rs:23 — the ? operator causes the function to return None on the first non-numeric /proc entry (e.g. cpu, self, net), so every F12 press spawns a new cosmic-term --drop-down process instead of sending SIGUSR1 to the existing one.
Fix: Replace ? with continue so non-PID directories are silently skipped.
// Before (line 23):
let pid = entry.file_name().to_string_lossy().parse::().ok()?;

// After:
let pid = match entry.file_name().to_string_lossy().parse::() {
Ok(pid) => pid,
Err(_) => continue,
};
Also applies to the cmdline read on the next line — ok()? should be continue, not ?, for the same reason.

@asilenkov

Copy link
Copy Markdown

more on this

  • top bar with File, Edit, View is not working at all, Layer surface can't create popup submenus.
  • fonts filter are a little bit not optimal. Filter drops all the fonts which don't have Bold variant. Better to let it make synthetic bold befor filtering.
    Everything else is quite good, thanks for this.

@rnbwdsh

rnbwdsh commented Jul 30, 2026

Copy link
Copy Markdown

Hello! I've tried this on Fedora 44, works for me, thanks for your efforts.....

I'm not sure i understand the feedback regarding the find_existing_dropdown_pid as that is a function name I use in my branch / pull request: #881 and is not used in this branch.

But my find_existing_dropdown_pid doesn't use any ? and isn't in a loop on dropdown.rs:23 that could be continued, line 23 is the Err(_) => return None, part of the read_dir so the error handling if you don't have a readable /proc.

Is it possible you are on an old version? I have force push squashed the branch as there was some messy stuff inbetween.

fonts filter are a little bit not optimal

I don't understand what you mean here, neither my nor timbz code interacts with fonts at all? (Even though a very strong font filtering currently seems to exist, i can confirm that but that's not related to this branch?

top bar with File, Edit, View is not working at all, Layer surface can't create popup submenus.

I'll quickly work that one out, i had that already working in the process but I think I broke it in some refactoring. For some reason, the mouse over effect of these buttons already works (see screenshot in my mr), they just don't seem to properly react any more

@rnbwdsh

rnbwdsh commented Jul 30, 2026

Copy link
Copy Markdown

i managed to fix the menu bar in a diff as minimal as possible (i think) as "Layer surface can't create popup submenus" is not fully correct for cosmic.

Sadly, I can't screenshot it (with cosmic-screenshot, at least) because the screenshot tool overlay interfers with the surface menu overlay.

c748bf3

Edit: I also rebased on the current master and it'd be ready to review/merge.

rnbwdsh added a commit to rnbwdsh/cosmic-term that referenced this pull request Jul 30, 2026
…d behavior if not used

Behavior on first launch: create a surface, add a signal handler, render the terminal into that overlay surface
Behavior on later launches: find the process that was launched with "--drop-down" and send a signal to it (currently via spawning a process)
Handle USR1 signals for toggling dropdown
Custom right click context menu in dropdown mode, as maximizing makes no sense
Added setting: A secondary show-headers-dropdown that's only visible in drop down mode
Added setting: The height of the dropdown in px, I'd like to do relative but to my understanding wayland doesn't trivially allow that
Bug byepass in iced: When creating the overlay without any delay, the window is transparent but not "frosted"

This is hugely based on pop-os#673 and just rebased and refactored, as various menu things were broken for me.

I think this MR is relevant, because people are already vibe coding a non-working version of this: https://github.com/M0Rf30/cosmic-ext-quake-terminal

This was partially created with the help of AI.
@asilenkov

Copy link
Copy Markdown

I'm not sure i understand the feedback regarding the find_existing_dropdown_pid

Sorry for a confusion, probably I messed with git a bit, that's probably another PR not yours, sorry.
Font filter — pre-existing in master, not part of any drop-down PR, just a small fix to handle fonts better.
And menubar is probably libcosmic glitch

@rnbwdsh

rnbwdsh commented Jul 30, 2026

Copy link
Copy Markdown

no the menu bar was a real problem, because a regular responsive_menu_bar has the problems you described, but a menu::bar is fine, so that was a real issue / regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants