[GH-ISSUE #5903] docs: non-ASCII hyphens in commands - copy pasting them fails on command line #3128

Closed
opened 2026-05-05 09:45:52 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @danielkrajnik on GitHub (Jul 16, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5903

Description

Copying flags from man pages doesn't work - hyphens are encoded as e280 90 instead 2d.

They will look the same, but firejail will error (for example):

Error: invalid --writable‐run‐user command line option

Steps to Reproduce

  1. man firejail
  2. search for an option, e.g. / --writable‐run‐user
  3. select it, copy it, paste it into command line, e.g. firejail --writable‐run‐user
  4. run command
    *5. paste it into a hex editor:

image

Expected Behaviour

enter shell in firejail with /run/user/$UID/gnupg available

Actual Behaviour

Error: invalid --writable‐run‐user command line option

Environment

  • Linux distribution and version: "EndeavourOS" - Arch - package: extra/firejail 0.9.72-1
  • Firejail version:
firejail version 0.9.72

Compile time support:
        - always force nonewprivs support is disabled
        - AppArmor support is enabled
        - AppImage support is enabled
        - chroot support is enabled
        - D-BUS proxy support is enabled
        - file transfer support is enabled
        - firetunnel support is disabled
        - IDS support is disabled
        - networking support is enabled
        - output logging is enabled
        - overlayfs support is disabled
        - private-home support is enabled
        - private-cache and tmpfs as user enabled
        - SELinux support is disabled
        - user namespace support is enabled
        - X11 sandboxing support is enabled

Checklist

  • [] The issues is caused by firejail (i.e. running the program by path (e.g. /usr/bin/vlc) "fixes" it).
  • [] I can reproduce the issue without custom modifications (e.g. globals.local).
  • [] The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • I have performed a short search for similar issues (to avoid opening a duplicate).
    • I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
  • I used --profile=PROFILENAME to set the right profile. (Only relevant for AppImages)
Originally created by @danielkrajnik on GitHub (Jul 16, 2023). Original GitHub issue: https://github.com/netblue30/firejail/issues/5903 ### Description Copying flags from man pages doesn't work - hyphens are encoded as `e280 90` instead `2d`. They will look the same, but firejail will error (for example): ``` Error: invalid --writable‐run‐user command line option ``` ### Steps to Reproduce 1. `man firejail` 2. search for an option, e.g. `/ --writable‐run‐user` 3. select it, copy it, paste it into command line, e.g. `firejail --writable‐run‐user` 4. run command *5. paste it into a hex editor: ![image](https://github.com/netblue30/firejail/assets/15096799/9a0c20be-3876-4f30-aec6-b4980dcf5629) ### Expected Behaviour enter shell in firejail with `/run/user/$UID/gnupg` available ### Actual Behaviour `Error: invalid --writable‐run‐user command line option` ### Environment - Linux distribution and version: "EndeavourOS" - Arch - package: extra/firejail 0.9.72-1 - Firejail version: ``` firejail version 0.9.72 Compile time support: - always force nonewprivs support is disabled - AppArmor support is enabled - AppImage support is enabled - chroot support is enabled - D-BUS proxy support is enabled - file transfer support is enabled - firetunnel support is disabled - IDS support is disabled - networking support is enabled - output logging is enabled - overlayfs support is disabled - private-home support is enabled - private-cache and tmpfs as user enabled - SELinux support is disabled - user namespace support is enabled - X11 sandboxing support is enabled ``` ### Checklist - [] The issues is caused by firejail (i.e. running the program by path (e.g. `/usr/bin/vlc`) "fixes" it). - [] I can reproduce the issue without custom modifications (e.g. globals.local). - [] The program has a profile. (If not, request one in `https://github.com/netblue30/firejail/issues/1139`) - [ ] The profile (and redirect profile if exists) hasn't already been fixed [upstream](https://github.com/netblue30/firejail/tree/master/etc). - [x] I have performed a short search for similar issues (to avoid opening a duplicate). - [ ] I'm aware of `browser-allow-drm yes`/`browser-disable-u2f no` in `firejail.config` to allow DRM/U2F in browsers. - [ ] I used `--profile=PROFILENAME` to set the right profile. (Only relevant for AppImages)
gitea-mirror 2026-05-05 09:45:52 -06:00
Author
Owner

@vinc17fr commented on GitHub (Sep 26, 2023):

This is due to the fact that some "-" characters are not escaped with a backslash.

<!-- gh-comment-id:1735423058 --> @vinc17fr commented on GitHub (Sep 26, 2023): This is due to the fact that some "-" characters are not escaped with a backslash.
Author
Owner

@ghost commented on GitHub (Sep 26, 2023):

@danielkrajnik When doing the 4 steps to reproduce (in my preferred xfce4-terminal) it actually works fine for me:

$ ls /run/user/$UID/gnupg
S.dirmngr  S.gpg-agent  S.gpg-agent.browser  S.gpg-agent.extra  S.gpg-agent.ssh

Perhaps it's dependent on the terminal-emulator? Have you tried a different one than what you normally use yet?

<!-- gh-comment-id:1736089521 --> @ghost commented on GitHub (Sep 26, 2023): @danielkrajnik When doing the 4 steps to reproduce (in my preferred xfce4-terminal) it actually works fine for me: ```sh $ ls /run/user/$UID/gnupg S.dirmngr S.gpg-agent S.gpg-agent.browser S.gpg-agent.extra S.gpg-agent.ssh ``` Perhaps it's dependent on the terminal-emulator? Have you tried a different one than what you normally use yet?
Author
Owner

@rusty-snake commented on GitHub (Sep 26, 2023):

@glitsj16 even if it does not happen with all terminals/viewer/... the format is wrong. See @vinc17fr post which writes it down the first time.

with /run/user/$UID/gnupg available

Has nothing todo with writable-run-user.

<!-- gh-comment-id:1736098408 --> @rusty-snake commented on GitHub (Sep 26, 2023): @glitsj16 even if it does not happen with all terminals/viewer/... the format is wrong. See @vinc17fr post which writes it down the first time. > with /run/user/$UID/gnupg *available* Has nothing todo with writable-run-user.
Author
Owner

@danielkrajnik commented on GitHub (Sep 26, 2023):

it actually works fine for me

Strange, it is working for me now as well even though it's the same terminal (alacritty). Maybe switching from Wayland to X11? Or maybe something else changed since July.

<!-- gh-comment-id:1736135547 --> @danielkrajnik commented on GitHub (Sep 26, 2023): > it actually works fine for me Strange, it is working for me now as well even though it's the same terminal (alacritty). Maybe switching from Wayland to X11? Or maybe something else changed since July.
Author
Owner

@ghost commented on GitHub (Sep 26, 2023):

Has nothing todo with writable-run-user.

@glitsj16 even if it does not happen with all terminals/viewer/... the format is wrong. See @vinc17fr post which writes it down the first time.

@rusty-snake

The format might be wrong, but how do you explain it sometimes works and sometimes it doesn't? Or in other words, do you have an actionable thing in mind by which we could fix this?

Maybe switching from Wayland to X11?

@danielkrajnik

That's what I'm seeing as well. Not that I can explain the difference...

<!-- gh-comment-id:1736172455 --> @ghost commented on GitHub (Sep 26, 2023): > Has nothing todo with writable-run-user. > @glitsj16 even if it does not happen with all terminals/viewer/... the format is wrong. See @vinc17fr post which writes it down the first time. @rusty-snake The format might be wrong, but how do you explain it sometimes works and sometimes it doesn't? Or in other words, do you have an actionable thing in mind by which we could fix this? > Maybe switching from Wayland to X11? @danielkrajnik That's what I'm seeing as well. Not that I can explain the difference...
Author
Owner

@rusty-snake commented on GitHub (Sep 26, 2023):

https://github.com/netblue30/firejail/issues/5903#issuecomment-1735423058 proper escaping with a backslash.

<!-- gh-comment-id:1736178135 --> @rusty-snake commented on GitHub (Sep 26, 2023): https://github.com/netblue30/firejail/issues/5903#issuecomment-1735423058 proper escaping with a backslash.
Author
Owner

@ghost commented on GitHub (Sep 26, 2023):

#5903 (comment) proper escaping with a backslash.

That's already the case:

72edd9667b/src/man/firejail.1.in (L3116)

<!-- gh-comment-id:1736207780 --> @ghost commented on GitHub (Sep 26, 2023): > #5903 (comment) proper escaping with a backslash. That's already the case: https://github.com/netblue30/firejail/blob/72edd9667b27ce0a2779f5000ca0a6a1eb0d67a2/src/man/firejail.1.in#L3116
Author
Owner

@danielkrajnik commented on GitHub (Sep 26, 2023):

Maybe switching from Wayland to X11?

I've just tried logging out of X11 and logging back into Wayland and it still worked (hyphens were again correctly copied as hex 2d). Both on KDE Plasma. Sorry, not sure what's caused it before.

<!-- gh-comment-id:1736230277 --> @danielkrajnik commented on GitHub (Sep 26, 2023): > Maybe switching from Wayland to X11? I've just tried logging out of X11 and logging back into Wayland and it still worked (hyphens were again correctly copied as hex `2d`). Both on KDE Plasma. Sorry, not sure what's caused it before.
Author
Owner

@kmk3 commented on GitHub (Sep 26, 2023):

I can confirm that this was a problem when the issue was opened, though I can't
immediately reproduce it now either with man-db 2.11.2-1 on Artix.

I also had attempted a regex to fix this, but I didn't finish it.

This is what I had written (the examples are current):


2. search for an option, e.g. / --writable‐run‐user

Error: invalid --writable‐run‐user command line option

GNU man ("man-db" package on Arch Linux) converts - (hyphen-minus) into
e28090 in the output, unless it's escaped as \- in the source and currently
only the first ones are escaped in the man pages, such as in
\-\-writable-run-user (it should be \-\-writable\-run\-user):

$ git grep -E 'writable\\?-run\\?-user' -- src/man/firejail.1.in
src/man/firejail.1.in:\fB\-\-writable-run-user
src/man/firejail.1.in:$ sudo firejail --writable-run-user

Most/all options are unfortunately also half-escaped:

$ git grep ' \\-\\-[^ ]*-' -- src/man/firejail.1.in | head
src/man/firejail.1.in:firejail {\-? | \-\-debug-caps | \-\-debug-errnos | \-\-debug-syscalls | \-\-debug-syscalls32 | \-\-debug-protocols | \-\-help | \-\-version}
src/man/firejail.1.in:$ firejail \-\-dbus-system=none
src/man/firejail.1.in:$ firejail \-\-dbus-user=none
src/man/firejail.1.in:$ firejail \-\-debug-blacklists firefox
src/man/firejail.1.in:$ firejail \-\-debug-caps
src/man/firejail.1.in:$ firejail \-\-debug-errnos
src/man/firejail.1.in:$ firejail \-\-debug-protocols
src/man/firejail.1.in:$ firejail \-\-debug-syscalls
src/man/firejail.1.in:$ firejail \-\-debug-whitelists firefox
src/man/firejail.1.in:$ firejail \-\-disable-mnt firefox

Note that mandoc does not convert them, so this seems to be a GNU-specific
thing.

<!-- gh-comment-id:1736297645 --> @kmk3 commented on GitHub (Sep 26, 2023): I can confirm that this was a problem when the issue was opened, though I can't immediately reproduce it now either with man-db 2.11.2-1 on Artix. I also had attempted a regex to fix this, but I didn't finish it. This is what I had written (the examples are current): --- > 2\. search for an option, e.g. `/ --writable‐run‐user` > `Error: invalid --writable‐run‐user command line option` GNU man ("man-db" package on Arch Linux) converts `-` (hyphen-minus) into `e28090` in the output, unless it's escaped as `\-` in the source and currently only the first ones are escaped in the man pages, such as in `\-\-writable-run-user` (it should be `\-\-writable\-run\-user`): ```console $ git grep -E 'writable\\?-run\\?-user' -- src/man/firejail.1.in src/man/firejail.1.in:\fB\-\-writable-run-user src/man/firejail.1.in:$ sudo firejail --writable-run-user ``` Most/all options are unfortunately also half-escaped: ```console $ git grep ' \\-\\-[^ ]*-' -- src/man/firejail.1.in | head src/man/firejail.1.in:firejail {\-? | \-\-debug-caps | \-\-debug-errnos | \-\-debug-syscalls | \-\-debug-syscalls32 | \-\-debug-protocols | \-\-help | \-\-version} src/man/firejail.1.in:$ firejail \-\-dbus-system=none src/man/firejail.1.in:$ firejail \-\-dbus-user=none src/man/firejail.1.in:$ firejail \-\-debug-blacklists firefox src/man/firejail.1.in:$ firejail \-\-debug-caps src/man/firejail.1.in:$ firejail \-\-debug-errnos src/man/firejail.1.in:$ firejail \-\-debug-protocols src/man/firejail.1.in:$ firejail \-\-debug-syscalls src/man/firejail.1.in:$ firejail \-\-debug-whitelists firefox src/man/firejail.1.in:$ firejail \-\-disable-mnt firefox ``` Note that mandoc does not convert them, so this seems to be a GNU-specific thing.
Author
Owner

@vinc17fr commented on GitHub (Sep 26, 2023):

#5903 (comment) proper escaping with a backslash.

That's already the case:

72edd9667b/src/man/firejail.1.in (L3116)

Here I can see

\fB\-\-writable-run-user

The first two are properly escaped, so that they appear correctly in the man page. The other two are not escaped, so that they appear as U+2010 HYPHEN in the man page. This confirms the issue.

<!-- gh-comment-id:1736322928 --> @vinc17fr commented on GitHub (Sep 26, 2023): > > #5903 (comment) proper escaping with a backslash. > > That's already the case: > > https://github.com/netblue30/firejail/blob/72edd9667b27ce0a2779f5000ca0a6a1eb0d67a2/src/man/firejail.1.in#L3116 Here I can see ``` \fB\-\-writable-run-user ``` The first two are properly escaped, so that they appear correctly in the man page. The other two are not escaped, so that they appear as U+2010 HYPHEN in the man page. This confirms the issue.
Author
Owner

@vinc17fr commented on GitHub (Sep 27, 2023):

GNU man ("man-db" package on Arch Linux) converts - (hyphen-minus) into e28090 in the output, unless it's escaped as \- in the source and currently only the first ones are escaped in the man pages, such as in \-\-writable-run-user (it should be \-\-writable\-run\-user):
[...]
Note that mandoc does not convert them, so this seems to be a GNU-specific thing.

This actually comes from a recent change in groff. See the discussion in Debian bug 1041731.

<!-- gh-comment-id:1737452985 --> @vinc17fr commented on GitHub (Sep 27, 2023): > GNU man ("man-db" package on Arch Linux) converts `-` (hyphen-minus) into `e28090` in the output, unless it's escaped as `\-` in the source and currently only the first ones are escaped in the man pages, such as in `\-\-writable-run-user` (it should be `\-\-writable\-run\-user`): [...] > Note that mandoc does not convert them, so this seems to be a GNU-specific thing. This actually comes from a recent change in `groff`. See the discussion in [Debian bug 1041731](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1041731).
Author
Owner

@netblue30 commented on GitHub (Jan 8, 2026):

Fixed, thanks for the bug.

e256efe645

<!-- gh-comment-id:3723807693 --> @netblue30 commented on GitHub (Jan 8, 2026): Fixed, thanks for the bug. https://github.com/netblue30/firejail/commit/e256efe645f214a62aeef32d331c305d28868f52
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#3128
No description provided.