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

Fix displayed name for GNOME Terminal and Black Box #174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bfabio
Copy link

@bfabio bfabio commented Jun 19, 2024

libmacchina uses /proc//comm, which is limited to 15 chars and it's not guaranteed to hold a user friendly name.

For example GNOME Terminal is actually /usr/libexec/gnome-terminal-server and its comm is gnome-terminal-.

Add a replacement function that returns user friendly names and that can be expanded with more.

libmacchina uses /proc/<pid>/comm, which is limited to 15 chars and
it's not guaranteed to hold a user friendly name.

For example GNOME Terminal is actually /usr/libexec/gnome-terminal-server
and its `comm` is `gnome-terminal-`.

Add a replacement function that returns user friendly names and
that can be expanded with more.
@grtcdr
Copy link
Member

grtcdr commented Jun 19, 2024

While the current method for looking up the terminal emulator is a complete hack - it's probably best to ask the display server or compositor what the current window is, but to my knowledge Wayland still does not offer this - this is a good initiative.

Comment on lines 442 to +443
let terminal = terminal_name();
let terminal = terminal_replacements(&terminal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a one-liner, the function should also be renamed to convey its function more clearly.

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

Successfully merging this pull request may close these issues.

2 participants