After some updates, I started to experience a problem that when connecting to my Gentoo machine using "shell link" in Midnight Commander, it is unable to process non-ascii characters, it shows numbers instead and it is unable to work with such files/directories. I haven't changed any system/sshd settings meanwhile, it got broken by updates (unfortunately, I don't know when exactly to try to find the culprit). The problem appears when the Gentoo machine acts as remote, connecting from that machine elsewhere works just fine. Also using plain scp or KDE fish protocol there is no problem, the problem is only with mc. Reproducible: Always Steps to Reproduce: 1. run sshd 2. touch ~/"ěščř" 3. mc 4. Right => Shell link, connect to user@localhost:/~ 5. try to find the "ěščř" file on the right panel, try to copy it Actual Results: bad luck ... but there is a file named "304233305241304215305231" trying to view it you get an error that the file cannot be retrieved Expected Results: "ěščř" file listed, you can copy it my locale is cs_CZ.utf8
I can confirm this issue. I'm experiencing the very same behavior with Czech national characters. I'm running Gentoo stable, all packages updated.
note that I haven't reported this for app-misc/mc directly because using mc to connect to Fedora machine worked just fine, so the problem seemed to be on the server side rather than the client itself now, after some updates (heck, again, I can't trace which exact one...), connecting to Fedora (39) machine got broken too also, meanwhile I hit the same problem with plain scp when using combination of non-ascii characters and wildcards but managed to workaround that using quotation marks ... unfortunately, I was in a hurry and didn't make note about the case to be able to post a reproducer for debugging (I hit that just once, trying something like "scp user@remote:/path/ešč* ." or so works just fine)
are app-misc/mc-4.8.29 and app-misc/mc-4.8.30-r1 equally broken?
(In reply to Sam James from comment #3) > are app-misc/mc-4.8.29 and app-misc/mc-4.8.30-r1 equally broken? yes
If plain scp has got problems as well, I am beginning to suspect the problem lies with something other than Midnight Commander... For completeness though, what USE flags have you emerged app-misc/mc with?
(In reply to Marek Szuba from comment #5) > If plain scp has got problems as well, I am beginning to suspect the problem > lies with something other than Midnight Commander... yeah, I think so, as I said in my initial description, it looks more like server-side thing ("when Gentoo acts as remote" - after some time/updates, it got broken also with Fedora as remote; I don't have other distros at hand to test ...) > For completeness > though, what USE flags have you emerged app-misc/mc with? USE="X edit nls slang unicode -gpm -sftp -spell -test"
Created attachment 879631 [details] Workaround for broken national characters After some debugging I was able to fix somehow the issue. When I replaced in MC sources explicit setup of locales to "C" by "C.UTF-8", national characters got fixed. See the attached patch (can be placed to /etc/portage/patches/app-misc/mc). Something has probably changed in behavior of sshd or of system locales? Unfortunately I have no idea. I'm aware that this is only a workaround and not a proper fix - the very same MC sources with "C" locales were working fine some time ago. But hopefully it helps...
Created attachment 881877 [details] Examples "mc -a" 4.8.29 and 4.8.30-r1 (xterm). Plain "mc" 4.8.30-r1 (urxvt)
Sorry about the delay, I am still very much on devaway. Thank you very much for having investigated the issue and the workaround, the patch looks straightforward enough so I'll add it - conditional on USE=unicode I think, just in case - today.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13e8f68494f4c02c91bc047a8224d8b059105b3e commit 13e8f68494f4c02c91bc047a8224d8b059105b3e Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2024-01-24 16:28:10 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2024-01-24 16:30:30 +0000 app-misc/mc: fix broken non-ASCII characters in shell links With many thanks to the reporter of and the participants in the relevant bug, for the thorough debugging and having eventually found the fix. Closes: https://bugs.gentoo.org/916528 Signed-off-by: Marek Szuba <marecki@gentoo.org> ....8.30-fish_fix_broken_national_characters.patch | 40 +++++++ app-misc/mc/mc-4.8.30-r2.ebuild | 127 +++++++++++++++++++++ 2 files changed, 167 insertions(+)