Ticket #4138 (new defect)
Right to left language (like Hebrew) causes name and size columns to be switched
Reported by: | ygoldfill | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Future Releases |
Component: | mc-core | Version: | 4.8.24 |
Keywords: | Cc: | u34@…, mooffie, dickey | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
When displaying directories or file names that are of both English and Hebrew the size column contents is shifted to the left and the name is shifted to the right for Hebrew names.
$ LC_MESSAGES=C mc -V
GNU Midnight Commander 4.8.24
Built with GLib 2.62.4
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
$ mc --configure-options
'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' 'PYTHON=/usr/bin/python3' '--disable-rpath' '--enable-charset' '--enable-largefile' '--enable-vfs-cpio' '--enable-vfs-extfs' '--enable-vfs-fish' '--enable-vfs-ftp' '--enable-vfs-sfs' '--enable-vfs-sftp' '--enable-vfs-smb' '--enable-vfs-tar' '--with-x' '--with-gpm-mouse' '--with-screen=slang' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
Attachments
Change History
comment:1 Changed 4 years ago by ygoldfill
- Version changed from master to 4.8.24
- Milestone 4.8.26 deleted
comment:4 in reply to: ↑ 3 Changed 4 years ago by andrew_b
Replying to ygoldfill:
cat /etc/locale.conf
LANG="en_US.UTF-8"
Please show the output of command locale and files ~/.config/mc/in and ~/.config/mc/panels.ini
comment:5 Changed 4 years ago by ygoldfill
[ygoldfill@Guji-Linux ~]$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
[ygoldfill@Guji-Linux mc]$ cat ini [Midnight-Commander] verbose=true pause_after_run=1 shell_patterns=true auto_save_setup=true preallocate_space=false auto_menu=false use_internal_view=true use_internal_edit=true clear_before_exec=true confirm_delete=true confirm_overwrite=true confirm_execute=false confirm_history_cleanup=true confirm_exit=false confirm_directory_hotlist_delete=true safe_delete=false mouse_repeat_rate=100 double_click_speed=250 use_8th_bit_as_meta=false confirm_view_dir=false mouse_move_pages_viewer=true mouse_close_dialog=false fast_refresh=false drop_menus=false wrap_mode=true old_esc_mode=false old_esc_mode_timeout=1000000 cd_symlinks=true show_all_if_ambiguous=false max_dirt_limit=10 use_file_to_guess_type=true alternate_plus_minus=false only_leading_plus_minus=true show_output_starts_shell=false xtree_mode=false num_history_items_recorded=60 file_op_compute_totals=true classic_progressbar=true vfs_timeout=60 ftpfs_directory_timeout=900 use_netrc=true ftpfs_retry_seconds=30 ftpfs_always_use_proxy=false ftpfs_use_passive_connections=true ftpfs_use_passive_connections_over_proxy=false ftpfs_use_unix_list_options=true ftpfs_first_cd_then_ls=true fish_directory_timeout=900 editor_tab_spacing=8 editor_word_wrap_line_length=72 editor_fill_tabs_with_spaces=false editor_return_does_auto_indent=true editor_backspace_through_tabs=false editor_fake_half_tabs=true editor_option_save_mode=0 editor_option_save_position=true editor_option_auto_para_formatting=false editor_option_typewriter_wrap=false editor_edit_confirm_save=true editor_syntax_highlighting=true editor_persistent_selections=true editor_drop_selection_on_copy=true editor_cursor_beyond_eol=false editor_cursor_after_inserted_block=false editor_visible_tabs=true editor_visible_spaces=true editor_line_state=false editor_simple_statusbar=false editor_check_new_line=false editor_show_right_margin=false editor_group_undo=false editor_ask_filename_before_edit=false nice_rotating_dash=true mcview_remember_file_position=false auto_fill_mkdir_name=true copymove_persistent_attr=true editor_backup_extension=~ editor_filesize_threshold=64M editor_stop_format_chars=-+*\\,.;:&> mcview_eof= ignore_ftp_chattr_errors=true skin=default filepos_max_saved_entries=1024 editor_state_full_filename=false safe_overwrite=false [Layout] message_visible=true keybar_visible=true xterm_title=true output_lines=0 command_prompt=true menubar_visible=true free_space=true horizontal_split=false vertical_equal=true left_panel_size=81 horizontal_equal=true top_panel_size=1 [Misc] timeformat_recent=%b %e %H:%M timeformat_old=%b %e %Y ftp_proxy_host=gate ftpfs_password=anonymous@ display_codepage=UTF-8 source_codepage=Other_8_bit autodetect_codeset= spell_language=en clipboard_store= clipboard_paste= [Colors] base_color= xterm-256color= color_terminals= linux= [Panels] show_mini_info=true kilobyte_si=false mix_all_files=false show_backups=true show_dot_files=true fast_reload=false fast_reload_msg_shown=false mark_moves_down=true reverse_files_only=true auto_save_setup_panels=false navigate_with_arrows=false panel_scroll_pages=true mouse_move_pages=true filetype_mode=true permission_mode=false torben_fj_mode=false quick_search_mode=2 select_flags=6 panel_scroll_center=false [Panelize] Find *.orig after patching=find . -name \\*.orig -print Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print Find rejects after patching=find . -name \\*.rej -print Modified git files=git ls-files --modified
pannels.ini is empty
comment:8 follow-up: ↓ 9 Changed 4 years ago by ygoldfill
strange - just tested it on the Linux virtual machine (ubuntu based) in my chromebook and I got the same results. The mc version there is 4.8.18. The locale is the same.
BTW, I can't build mc after checking out from git :
make[2]: Entering directory '/home/ygoldfill/Downloads/mc/po'
make[2]: * No rule to make target 'all'. Stop.
comment:10 Changed 4 years ago by ygoldfill
Seems that it depends on the system. On systems (like Fedora 31) where the Hebrew is displayed properly (not reversed) issuing 'ls' in shell, then mc is swapping the columns.
On other systems like latest raspbian on raspberry pi4, the Hebrew is reversed and then mc is OK.
I tried comparing the environment variables in there settings but could not make it out.
comment:11 Changed 3 years ago by ZGMxYWFh
Same issue here. Right to left language, namely Hebrew, causes name and size columns to be switched. But only when mc runs on X-windows. Not when mc runs on a virtual console. On the virtual console I get Hebrew characters as filled squares, not readable characters. Because I don't have Hebrew fonts for the virtual console. Still, the switching of the columns does not happen on the virtual console. With X-Windows I am also using -S sand256 as a single command line option, if that matters.
$ cat /etc/locale.conf LANG=en_US.UTF-8
$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
$ LC_ALL=C mc -V GNU Midnight Commander 4.8.27 Built with GLib 2.68.3 Built with S-Lang 2.3.2 with terminfo database With builtin Editor With subshell support as default With support for background operations With mouse support on xterm and Linux console With support for X11 events With internationalization support With multiple codepages support With ext2fs attributes support Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
$ mc --configure-options '--prefix=/usr' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--enable-vfs-smb' '--with-screen=slang' '--with-x' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'
$ cat ~/.config/mc/ini [Midnight-Commander] verbose=true shell_patterns=true auto_save_setup=true preallocate_space=false auto_menu=false use_internal_view=true use_internal_edit=true clear_before_exec=true confirm_delete=true confirm_overwrite=true confirm_execute=false confirm_history_cleanup=true confirm_exit=false confirm_directory_hotlist_delete=false confirm_view_dir=false safe_delete=false safe_overwrite=false use_8th_bit_as_meta=false mouse_move_pages_viewer=true mouse_close_dialog=false fast_refresh=false drop_menus=false wrap_mode=true old_esc_mode=true cd_symlinks=true show_all_if_ambiguous=false use_file_to_guess_type=true alternate_plus_minus=false only_leading_plus_minus=true show_output_starts_shell=false xtree_mode=false file_op_compute_totals=true classic_progressbar=true use_netrc=true ftpfs_always_use_proxy=false ftpfs_use_passive_connections=true ftpfs_use_passive_connections_over_proxy=false ftpfs_use_unix_list_options=true ftpfs_first_cd_then_ls=true ignore_ftp_chattr_errors=true editor_fill_tabs_with_spaces=false editor_return_does_auto_indent=true editor_backspace_through_tabs=false editor_fake_half_tabs=true editor_option_save_position=true editor_option_auto_para_formatting=false editor_option_typewriter_wrap=false editor_edit_confirm_save=true editor_syntax_highlighting=true editor_persistent_selections=true editor_drop_selection_on_copy=true editor_cursor_beyond_eol=false editor_cursor_after_inserted_block=false editor_visible_tabs=true editor_visible_spaces=true editor_line_state=false editor_simple_statusbar=false editor_check_new_line=false editor_show_right_margin=false editor_group_undo=false editor_state_full_filename=false editor_ask_filename_before_edit=false nice_rotating_dash=true mcview_remember_file_position=false auto_fill_mkdir_name=true copymove_persistent_attr=true pause_after_run=1 mouse_repeat_rate=100 double_click_speed=250 old_esc_mode_timeout=1000000 max_dirt_limit=10 num_history_items_recorded=60 vfs_timeout=60 ftpfs_directory_timeout=900 ftpfs_retry_seconds=30 fish_directory_timeout=900 editor_tab_spacing=8 editor_word_wrap_line_length=72 editor_option_save_mode=0 editor_backup_extension=~ editor_filesize_threshold=64M editor_stop_format_chars=-+*\\,.;:&> mcview_eof= skin=default filepos_max_saved_entries=1024 shadows=true [Layout] message_visible=true keybar_visible=true xterm_title=true output_lines=0 command_prompt=true menubar_visible=true free_space=true horizontal_split=false vertical_equal=true left_panel_size=31 horizontal_equal=true top_panel_size=1 [Misc] timeformat_recent=%b %e %H:%M timeformat_old=%b %e %Y ftp_proxy_host=gate ftpfs_password=anonymous@ display_codepage=UTF-8 source_codepage=Other_8_bit autodetect_codeset= clipboard_store= clipboard_paste= [Colors] base_color= xterm-256color= color_terminals= linux= xterm= [FindFile] file_case_sens=true file_shell_pattern=true file_find_recurs=true file_skip_hidden=false file_all_charsets=false content_case_sens=true content_regexp=false content_first_hit=false content_whole_words=false content_all_charsets=false ignore_dirs_enable=true ignore_dirs= [HotlistConfig] expanded_view_of_groups=0 [Panels] show_mini_info=true kilobyte_si=false mix_all_files=false show_backups=true show_dot_files=true fast_reload=false fast_reload_msg_shown=false mark_moves_down=true reverse_files_only=true auto_save_setup_panels=false navigate_with_arrows=false panel_scroll_pages=true panel_scroll_center=false mouse_move_pages=true filetype_mode=true permission_mode=false torben_fj_mode=false quick_search_mode=2 select_flags=6 simple_swap=false [Panelize] Find *.orig after patching=find . -name \\*.orig -print Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print Find rejects after patching=find . -name \\*.rej -print Modified git files=git ls-files –modified
$ cat ~/.config/mc/panels.ini
(~/.config/mc/panels.ini is empty)
It could be that ygoldfill #comment:10 holds here. But I am confused because I think that sometimes I get Hebrew reversed. Possibly not with ls output. like I wrote, I am confused about why I think that sometimes Hebrew words are reversed.
comment:12 follow-up: ↓ 13 Changed 3 years ago by ZGMxYWFh
More information for my #comment:11:
I have an old linux, from 2017, liveCD in which the problem is not seen. I will provide the details of its mc version, and so on, if requested. However, I think that ygoldfill #comment:10 is more relevant. I also wonder if the root of the problem is the terminal, and its underlying engine.
But before that, I think we should examine the behavior on a Linux virtual console.
I believe many users have Hebrew fonts for the virtual console on their system. Issuing something like
$ setfont /usr/share/kbd/consolefonts/LatArCyrHeb-14.psfu.gz
Which gives Latin, Hebrew, and 2 other character sets, might help. I believe many users have that file on their system. With such fonts used, the behavior I get in the virtual console is that both an ls command from the shell, and mc, display Hebrew file names in reverse, wrong, direction. As if they were written from left to right. Not from right to left, as they should be. The names are also justified to the left. Not what a right to left reader used to. Yet, with the virtual console there is no problem of mc switching the order of the name and size columns. That is the behavior that I get here.
Leaving the virtual console aside, let us return to X-windows.
With X-windows, I have experimented with two different terminals: lxterminal, and xterm. As an side, for the case of an lxterminal, the important piece of software for our matter is, probably, its vte3 virtual terminal emulator. The results I got are that in an lxterminal, both the ls command in the shell, and mc, display Hebrew file names with the correct direction. Yet, mc has the switching columns bug. In contrast, in an xterm, both the ls command in the shell, and mc, display Hebrew file names in the reverse, wrong, direction. But mc does not show the switching columns bug.
Looking again at the 2 screenshots that were posted earlier, ygoodfill screenshot, https://midnight-commander.org/attachment/ticket/4138/Screenshot%20from%202020-10-22%2017-35-43.png, manifests the bug. While the Hebrew file names are displayed as they should be. The names are also justified to the right, as is expected. In contrast, andrew_b screenshot, https://midnight-commander.org/attachment/ticket/4138/Screenshot%20at%202020-10-25%2010-53-10.png, does not manifests the bug. But that screenshot does display the Hebrew file names in the wrong direction. The names are justified to the left, which is not the usual
justification for an Hebrew reader. I wonder on which terminals were those screenshot obtained.
Since andrew_b's screenshot behaves the same as in a Linux virtual console, Can it be that the real problem is that there is no consensus to determine who, that is at which level, should the Right to Left languages get handled? Alternatively, should mc approach this bug by first obtaining a reasonable display at the virtual console?
comment:13 in reply to: ↑ 12 ; follow-up: ↓ 14 Changed 3 years ago by andrew_b
Replying to ZGMxYWFh:
andrew_b screenshot, https://midnight-commander.org/attachment/ticket/4138/Screenshot%20at%202020-10-25%2010-53-10.png, does not manifests the bug. But that screenshot does display the Hebrew file names in the wrong direction. The names are justified to the left, which is not the usual justification for an Hebrew reader. I wonder on which terminals were those screenshot obtained.
There was mate-terminal-1.12.1 based on libvte-0.28.2.
comment:14 in reply to: ↑ 13 ; follow-up: ↓ 15 Changed 3 years ago by ZGMxYWFh
Replying to andrew_b:
Replying to ZGMxYWFh:
There was mate-terminal-1.12.1 based on libvte-0.28.2.
sakura is a terminal from an 2017 liveCD, actually liveDVD, I have. It does not manifests the bug. Within sakura, mc displays Hebrew file names justified to the left. As if they were Latin names. And in a LTR, left to right manner. Not RTL, right to left, as Hebrew requires. It uses libvte-2.91. And so does the newer lxterminal, in which I can see the bug. Still, isn't it seem convincing that there is a tie between the bug and the terminal in which mc runs? I have copied the ldd output for my current, 2021Q4, lxterminal at the bottom of this message. It does mention usage of libfribidi. Perhaps this is the cause of the bug?
Other then the ldd output at the bottom of this message, all the following output is for mc 4.8.19 running in the sakura 3.3.4 terminal. That is, with packages from 2017.
$ sakura -v 2|& tail -1 # A liveDVD from 2017 sakura version is 3.3.4
$ ldd /usr/bin/sakura # A liveDVD from 2017 linux-vdso.so.1 (0x00007ffd6c3fd000) libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007f62bae53000) libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007f62bab5d000) libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007f62ba911000) libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007f62ba57d000) libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f62ba32b000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f62ba018000) libvte-2.91.so.0 => /usr/lib/libvte-2.91.so.0 (0x00007f62b9dc3000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f62b9a1f000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f62b981b000) libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007f62b960e000) libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f62b92cf000) libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f62b90be000) libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f62b8eb8000) libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007f62b8caf000) libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007f62b8981000) libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007f62b875a000) libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007f62b8534000) libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x00007f62b8305000) libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007f62b801f000) libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007f62b7e0a000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f62b7bc6000) libm.so.6 => /usr/lib/libm.so.6 (0x00007f62b78b3000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f62b7695000) libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f62b7492000) libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f62b7287000) libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f62b707c000) libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007f62b6e79000) libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f62b6c76000) libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007f62b6a36000) libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x00007f62b682e000) libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x00007f62b662c000) libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x00007f62b641d000) libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f62b620b000) librt.so.1 => /usr/lib/librt.so.1 (0x00007f62b6003000) libthai.so.0 => /usr/lib/libthai.so.0 (0x00007f62b5df9000) libz.so.1 => /usr/lib/libz.so.1 (0x00007f62b5be2000) libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f62b59cc000) libmount.so.1 => /usr/lib/libmount.so.1 (0x00007f62b577e000) libffi.so.6 => /usr/lib/libffi.so.6 (0x00007f62b5575000) libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f62b5302000) libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f62b5088000) libgnutls.so.30 => /usr/lib/libgnutls.so.30 (0x00007f62b4d1c000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f62b4994000) /lib64/ld-linux-x86-64.so.2 (0x00007f62bb764000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f62b4790000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f62b44cf000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f62b42a6000) libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007f62b3ffe000) libEGL.so.1 => /usr/lib/libEGL.so.1 (0x00007f62b3deb000) libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f62b3bb5000) libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f62b39b1000) libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007f62b37a3000) libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f62b3598000) libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f62b330d000) libatspi.so.0 => /usr/lib/libatspi.so.0 (0x00007f62b30dc000) libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f62b2e8c000) libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f62b2bfc000) libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f62b29d2000) libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007f62b27ca000) libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007f62b2584000) libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007f62b237f000) libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x00007f62b2050000) libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007f62b1cdf000) libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x00007f62b1acc000) libnettle.so.6 => /usr/lib/libnettle.so.6 (0x00007f62b1894000) libhogweed.so.4 => /usr/lib/libhogweed.so.4 (0x00007f62b165f000) libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f62b13cc000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f62b11b5000) libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f62b0fa5000) libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f62b0da1000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f62b0b9b000) libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f62b08e5000) libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f62b06b3000) libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f62bb8be000) libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f62b0487000) libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f62b0283000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f62b005d000) liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f62afe49000) libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f62afb3a000) libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f62af925000)
$ cat /etc/locale.conf # A liveDVD from 2017 LANG=en_US.UTF-8
$ locale # A liveDVD from 2017 LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
$ LC_ALL=C mc -V # A liveDVD from 2017 GNU Midnight Commander 4.8.19 Built with GLib 2.50.3 Using the S-Lang library with terminfo database With builtin Editor With subshell support as default With support for background operations With mouse support on xterm and Linux console With support for X11 events With internationalization support With multiple codepages support Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
$ mc --configure-options # A liveDVD from 2017 '--prefix=/usr' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--enable-vfs-smb' '--with-x' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'
$ cat .config/mc/ini # A liveDVD from 2017 [Midnight-Commander] verbose=true shell_patterns=true auto_save_setup=true preallocate_space=false auto_menu=false use_internal_view=true use_internal_edit=true clear_before_exec=true confirm_delete=true confirm_overwrite=true confirm_execute=false confirm_history_cleanup=true confirm_exit=false confirm_directory_hotlist_delete=false confirm_view_dir=false safe_delete=false use_8th_bit_as_meta=false mouse_move_pages_viewer=true mouse_close_dialog=false fast_refresh=false drop_menus=false wrap_mode=true old_esc_mode=true cd_symlinks=true show_all_if_ambiguous=false use_file_to_guess_type=true alternate_plus_minus=false only_leading_plus_minus=true show_output_starts_shell=false xtree_mode=false file_op_compute_totals=true classic_progressbar=true use_netrc=true ftpfs_always_use_proxy=false ftpfs_use_passive_connections=true ftpfs_use_passive_connections_over_proxy=false ftpfs_use_unix_list_options=true ftpfs_first_cd_then_ls=true ignore_ftp_chattr_errors=true editor_fill_tabs_with_spaces=false editor_return_does_auto_indent=true editor_backspace_through_tabs=false editor_fake_half_tabs=true editor_option_save_position=true editor_option_auto_para_formatting=false editor_option_typewriter_wrap=false editor_edit_confirm_save=true editor_syntax_highlighting=true editor_persistent_selections=true editor_drop_selection_on_copy=true editor_cursor_beyond_eol=false editor_cursor_after_inserted_block=false editor_visible_tabs=true editor_visible_spaces=true editor_line_state=false editor_simple_statusbar=false editor_check_new_line=false editor_show_right_margin=false editor_group_undo=false editor_state_full_filename=false editor_ask_filename_before_edit=false nice_rotating_dash=true mcview_remember_file_position=false auto_fill_mkdir_name=true copymove_persistent_attr=true pause_after_run=1 mouse_repeat_rate=100 double_click_speed=250 old_esc_mode_timeout=1000000 max_dirt_limit=10 num_history_items_recorded=60 vfs_timeout=60 ftpfs_directory_timeout=900 ftpfs_retry_seconds=30 fish_directory_timeout=900 editor_tab_spacing=8 editor_word_wrap_line_length=72 editor_option_save_mode=0 editor_backup_extension=~ editor_filesize_threshold=64M editor_stop_format_chars=-+*\\,.;:&> mcview_eof= skin=default [Layout] message_visible=1 keybar_visible=1 xterm_title=1 output_lines=0 command_prompt=1 menubar_visible=1 free_space=1 horizontal_split=0 vertical_equal=1 left_panel_size=42 horizontal_equal=1 top_panel_size=1 [Misc] timeformat_recent=%b %e %H:%M timeformat_old=%b %e %Y ftp_proxy_host=gate ftpfs_password=anonymous@ display_codepage=UTF-8 source_codepage=Other_8_bit autodetect_codeset= clipboard_store= clipboard_paste= [Colors] base_color= xterm-256color= color_terminals= linux= [Panels] show_mini_info=true kilobyte_si=false mix_all_files=false show_backups=true show_dot_files=true fast_reload=false fast_reload_msg_shown=false mark_moves_down=true reverse_files_only=true auto_save_setup_panels=false navigate_with_arrows=false panel_scroll_pages=true panel_scroll_center=false mouse_move_pages=true filetype_mode=true permission_mode=false torben_fj_mode=false quick_search_mode=2 select_flags=6 [Panelize] Find *.orig after patching=find . -name \\*.orig -print Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print Find rejects after patching=find . -name \\*.rej -print Modified git files=git ls-files --modified
$ du .config/mc/panels.ini # A liveDVD from 2017 0 .config/mc/panels.ini
So far for the liveDVD from 2017.
The following is for an up to date, 2021Q4, lxterminal.
$ ldd /usr/bin/lxterminal # current, 2021Q4, version linux-vdso.so.1 (0x00007ffd68bf4000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f97f5273000) libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007f97f4ac9000) libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007f97f49d5000) libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007f97f4983000) libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007f97f493d000) libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f97f48e3000) libvte-2.91.so.0 => /usr/lib/libvte-2.91.so.0 (0x00007f97f4853000) libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f97f4712000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f97f46f1000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f97f4525000) libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f97f44ae000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f97f44a7000) libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007f97f42e5000) libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007f97f42d4000) libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f97f41fc000) libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007f97f40dd000) libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007f97f40c5000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f97f4076000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f97f3faa000) libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x00007f97f3f8a000) libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007f97f3f7e000) libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007f97f3f55000) libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007f97f3e23000) libm.so.6 => /usr/lib/libm.so.6 (0x00007f97f3cdf000) libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f97f3cc9000) libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x00007f97f3c93000) libcloudproviders.so.0 => /usr/lib/libcloudproviders.so.0 (0x00007f97f3c7b000) libtracker-sparql-3.0.so.0 => /usr/lib/libtracker-sparql-3.0.so.0 (0x00007f97f3bbd000) libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f97f3bb4000) librt.so.1 => /usr/lib/librt.so.1 (0x00007f97f3ba9000) libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007f97f3b5e000) libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x00007f97f3b4c000) libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x00007f97f3b43000) libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x00007f97f3b3e000) libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f97f3b29000) libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f97f3b1d000) libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f97f3b16000) libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007f97f3b11000) libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f97f3b04000) libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f97f3aff000) libthai.so.0 => /usr/lib/libthai.so.0 (0x00007f97f3af4000) libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f97f3abb000) libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f97f3a29000) libtiff.so.5 => /usr/lib/libtiff.so.5 (0x00007f97f3995000) libffi.so.7 => /usr/lib/libffi.so.7 (0x00007f97f3989000) libgnutls.so.30 => /usr/lib/libgnutls.so.30 (0x00007f97f3788000) libicuuc.so.69 => /usr/lib/libicuuc.so.69 (0x00007f97f3595000) libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f97f34fa000) libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f97f3435000) libz.so.1 => /usr/lib/libz.so.1 (0x00007f97f341b000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f97f3205000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f97f31ea000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f97f31c0000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f97f31b7000) /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f97f53d4000) libmount.so.1 => /usr/lib/libmount.so.1 (0x00007f97f3157000) libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f97f313d000) libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f97f3118000) libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f97f310b000) libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007f97f30f9000) libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f97f30f4000) libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007f97f304c000) libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f97f301c000) libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f97f3009000) libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007f97f2ffb000) libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f97f2fa4000) libatspi.so.0 => /usr/lib/libatspi.so.0 (0x00007f97f2f69000) libstemmer.so.0 => /usr/lib/libstemmer.so.0 (0x00007f97f2ea2000) libicui18n.so.69 => /usr/lib/libicui18n.so.69 (0x00007f97f2b7b000) libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007f97f2a36000) libjson-glib-1.0.so.0 => /usr/lib/libjson-glib-1.0.so.0 (0x00007f97f2a09000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f97f289b000) libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007f97f2891000) libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f97f2782000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f97f2759000) libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x00007f97f2622000) libidn2.so.0 => /usr/lib/libidn2.so.0 (0x00007f97f2600000) libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007f97f247e000) libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x00007f97f2468000) libnettle.so.8 => /usr/lib/libnettle.so.8 (0x00007f97f2421000) libhogweed.so.6 => /usr/lib/libhogweed.so.6 (0x00007f97f23d8000) libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f97f2336000) libicudata.so.69 => /usr/lib/libicudata.so.69 (0x00007f97f07dd000) liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f97f07ba000) libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f97f07af000) libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f97f0673000) libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f97f066c000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f97f0664000) libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007f97f060e000) libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007f97f05eb000) libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f97f05c2000)
comment:15 in reply to: ↑ 14 ; follow-up: ↓ 16 Changed 3 years ago by andrew_b
Replying to ZGMxYWFh:
I have copied the ldd output for my current, 2021Q4, lxterminal at the bottom of this message. It does mention usage of libfribidi. Perhaps this is the cause of the bug?
Definitely yes. I've updated my libvte3 up to 0.58.3 with bidi support enabled and got the swapped name and size columns.
But this swap happens only when the column following the name column is numeric-only (size, inode, ...). If column contains not only digits (perm, mtime, owner, ...), columns are not swapped.
comment:16 in reply to: ↑ 15 Changed 3 years ago by ZGMxYWFh
Replying to andrew_b:
Replying to ZGMxYWFh:
I have copied the ldd output for my current, 2021Q4, lxterminal at the bottom of this message. It does mention usage of libfribidi. Perhaps this is the cause of the bug?
Definitely yes. I've updated my libvte3 up to 0.58.3 with bidi support enabled and got the swapped name and size columns.
But this swap happens only when the column following the name column is numeric-only (size, inode, ...). If column contains not only digits (perm, mtime, owner, ...), columns are not swapped.
Firstly, I am not sure how you configure MC to show the column following the name column not numeric-only. Before writing down how I got it, I would like to mention I suspect the problem is not only the swapping of the columns. It could be related to the incosistency in justification of RTL,such as Hebrew, file names. I tried to change my MC into Left ⇒ Listing Format… ⇒ Long file list. And justification of RTL file names in the Name column, which were prevoiusly right justified, became left justified. Getting back into Left ⇒ Listing Format… ⇒ Full file list changed it back to right justification. I think this is too a bidi issue. Which is probably done, or should be mostly done, by the bidi layer of the underlying terminal.
I used how can i set the default user defined listing mode in midnight commander and Creating Custom Format to get a non numeric only column after the file names column. I stored a suitable format in .config/mc/panels.ini. And after exiting and reactivating MC, I could activate that format at Left ⇒ Listing Format… ⇒ User defined. And the outcome was like you wrote. No columns were swapped. However, in my case, the justification of the Hebrew file names changed as well. They became left justified. I guess the same happened to you. But you forgot to mention it. Possibly because perhaps that is what you are used to.
As I wrote above, even though it looks like the swapping columns depends on the listing format, I think this is not the full picture. Do note that even when the swapping columns is not seen, the wrong justification of Hebrew file names is there. The reason is that the problem is, probably, not only the swapping columns. I suspect it is also about the justification of the file names. In order to see that, I think we should talk about bidi in more length. I have already wrote that I suspect the justification of the names, and the swapping columns issue, are related. I haven’t proved that. I also suspect, but haven’t proved, the justification problem is bidi related. If that is not enough, my knowledge about bidi is poor. Still, I hope that if you follow, you will see that my suspicions might stand on solid ground.
Many years ago, many people thought the RTL issue could be seteld by simply mirroring the order of characters in a line. Have the last character became the 1st character, the 2nd to last character became the 2nd character, and so on. Problem solved. It turned out this is far more complex than that. Possibly, but perhaps not limited to, due to having a mixture of LTR and RTL writing in the same line. Which is why they created quite a complex algorithm. As can be seen at Bidirectional text, there are strong characters. Weak characters. Neutral characters. Strong direction of the line. Weak direction for only some parts of the line. Artificial characters for directional enforcement. And some more definitions that are used to state, and implement, the bidi algorithm. My main point here is that it could be that the algorithm can not handle everything by itself. It must interact with the user. Sometimes it should be hinted by the user. I think in n our case, this user is the MC programmer. I think the MC program must control what libfribidi does. I assume, and hope, the libfribidi, and the terminal, have appropriate hooks, or API. An example for the need for such an API might be a human user writing a bidi document at some word processing software, for example LibreOffice? Writer. Even people who are doing only moderate volume of work on such bidi documents might recognize that sometimes the LibreOffice? Writer software does not put the characters in the right place. They have to intervene. Here is a picture of LibreOffice? 7.2.2.2 Writer intervene menu:
. I obtained it by Insert ⇒ Formatting Mark menu. This exact menu probably can not be seen in LibreOffice? installations of Latin only languages speaking users. One has to Tools ⇒ Options… ⇒ Language Settings ⇒ Languages ⇒ Have a tick for Complex text layout, and select an RTL language. (It could be any language in the drop down languages menu there will do.) Possibly coupled by Tools ⇒ Options… ⇒ Language Settings ⇒ Complex Text Layout ⇒ Cursor Control Movement: Logical. This is the libreOffice Writer way to let user intervene. I do not know how many entries in the picture are bidi related. But even if only 3 entries are bidi related, I think it is still should not taken lightly. Not only that. Users who tried to use those entries might be aware that it is not always that easy as picking the right entry from the list and inserting it into their document. Sometimes they have to use trial and error. The reason for their need for trial and error is not because the algorithm is poor. Rather, it is because they only superficially understand the algorithm. Which is why they sometimes don’t know which entry they have to pick, and what is the exact point in the line they should insert it in.
My bottom line is that, in my opinion, MC probably needs a programmer who knows the bidi algorithm to fix the column swapping, and the justification of the file names. And I am not sure there are not more issues. Such as locale that put dates, perhaps name of months, in an RTL language. The knowledge of the bidi algorithm will probably help such a programmer deal with libfribidi API, and what some other components of the terminal might do with that API. With the result that MC could provide the right hints for libfribidi where appropriate. And who knows. Perhaps bugs, or needs for changing the API, will emerge.
Rethinking about what looks to me your persistence to ignore the justification issue. Perhaps you are trying to imply the problem should be solved by smaller, measurable steps. As if you are saying: let us attempt to solve just the swapping of columns issue that were raised here. Forget, for now, about possible month names in an RTL language. Or have justification of the columns in a way that is expected by readers of RTL languages. Hopefully, that will take us to a better position. And then we will see how to continue. In that case, perhaps the first step should be for MC to insert an LTR forcing artificial character at the end of each column. That is, in each column, and for each line of that column, MC will insert an RTL forcing artificial character. Puting that in other words: if today MC has
| XXXXXXXX | XXXXXXXX | XXXXXXXX |
| XXXXXXXX | XXXXXXXX | XXXXXXXX |
Where X is any character, of any language, including white space. And a bar is the columns separating character, then after the change MC will have
F | XXXXXXXX F | XXXXXXXX F | XXXXXXXX F |
F | XXXXXXXX F | XXXXXXXX F | XXXXXXXX F |
where F is the bidi pseudo character to enforce an LTR direction. Of course, the Linux console, and any non bidi aware terminal, will get confused by that pseudo bidi character.
As I wrote, my bidi knowledge is superficial. And I don’t know MC internals.
comment:18 Changed 3 years ago by ZGMxYWFh
I hope the following can be reproduced by many users. And supports my claim that the bidi layer of the terminal is the one involved in the undesired output. Because MC does not insert bidi control sequences into its output.
Start by creating a zero size two files. Where the files names are composed of only two letters. One is an Hebrew letter. The other is an English letter. For example: $ touch Aא, and $ touch אA. (A is the first English letter in the ABC. א is the first Hebrew letter in the Hebrew alphabet.)
When letting MC, with the ‘Full file list’ format, list the files on a non bidi aware xterm, xterm -version XTerm(369), nothing looks unusual. But with a bidi aware lxterminal, lxterminal -v lxterminal 0.4.0, I get the line for one of the files displayed as expected. While the line for the other file is displayed with the switching columns problem that is reported in this bug report. And there is more then just switching columns. In the switched column line, the English letter from the file name is adjacent to the 0 file size. It is disjoint from the other letter of the file name.
Now I turned to LibreOffice? Writer. With the complex text layout, and the logical cursor control movement turned on. As described at my #comment:16.
Opening a new document, I wrote Aא at the beginning of the first line. And אA at the beginning of the second line. And then tried to add 0 as the third character of each line. Without any white spaces between the second letter and the 0 digit. Immediately after pressing the 0 key at my keyboard, the Aא line became Aא0. While the אA line turned into אA0. And inserting white spaces after the second letter does not change the outcome.
Edit: It could be important to mention that within LibreOffice? Writer, I have used here
- Format ⇒ Page Style... ⇒ Text direction ⇒ Left-to-right (horizontal)
- Format ⇒ Paragraph... ⇒ Alignment ⇒ Options ⇒ Left
and
- Format ⇒ Paragraph... ⇒ Alignment ⇒ Properties ⇒ Text direction ⇒ Left-to-right (LTR).
comment:19 follow-up: ↓ 20 Changed 3 years ago by zaytsev
- Cc mooffie added
Hi ZGMxYWFh,
I think you misunderstand the situation. It's much simpler than you believe. None of us can speak an RTL language, so we don't really understand your problem, and can't provide help fixing it - we just don't have skills and/or time for it. I think mooffie could speak and read Hebrew, but very unfortunately he's vanished a long time ago.
If you can provide a patch that fixes RTL without breaking anything else, then we could try to help you to get it in. Otherwise, we'll have to wait until someone else can help us.
All the best,
Yury
comment:20 in reply to: ↑ 19 ; follow-up: ↓ 22 Changed 3 years ago by andrew_b
Replying to zaytsev:
so we don't really understand your problem
The problem is shown in the first screenshot.
and can't provide help fixing it - we just don't have skills and/or time for it.
Unfortunately, that's true.
comment:21 Changed 3 years ago by ZGMxYWFh
Replying to zaytsev:
Hi ZGMxYWFh,
Hello Yuri
I think you misunderstand the situation.
I think I do understand the situation. Sort of.
None of us can speak an RTL language.
That is true.
so we don't really understand your problem
That is partially wrong. I am quite sure many of you are well aware of https://en.wikipedia.org/wiki/Mirror_writing.
The scientists observed that normal children exhibited signs of mirror writing while learning to write
is copied from that Wikipedia page. It could be some of you were also part of that children group. The bug issue is more complex, but not incredibly complex. MC has to deal with lines where some parts of the line progress in the left to right direction you are accustomed to. While other parts of those same lines progress in a right to left direction. Exactly the opposite of what you are used to. As in
Midnight Commander - rednammoC thgindiM
If you don't see it immediately, the left part of the line above reads MC in the usual direction. While the right part reads MC in the opposite direction. And there is a question if the computer should display it in the correct direction? And if so, how? How the computer would be able to keep such strings in its memory, and still have the terminal, or while making a hard copy of it, display it the way the user expects it. How the computer would know what is the left most letter? If you like, this is a more complex version of the question how the computer marks to itself the end of string, NULL character, while still keep it distinct from the other part of the string. Or how can the computer tell that some byte sequences are sometime English letters, sometimes Russian letters, and sometimes something else. Neither English. Nor Russian.
and can't provide help fixing it - we just don't have skills
That is totally wrong. Absolutely wrong. You can provide help. You have the skills.
The reason is that some other people already did part of the work. They have written an algorithm. https://www.unicode.org/reports/tr9/. One does not have to speak an RTL language to read that page. There is also an open source implementation. http://fribidi.org. Some terminals attempt to use it. Or be able to cope with applications that use it.
(you don’t have) time for it.
Unfortunately, with that I absolutely agree with you.
What I think has to be done is
- Before attempting to fix something, some preparation has to be done. Such as for MC to be able to automatically see if the underlying terminal uses libfribidi. If that is too hard, check the name of the underlying terminal (xterm, lxterminal, and so on), and its version. As a last resort, let the user set a variable at .config/mc/ini . Stating he want MC to run in a bidi aware terminal.
- The next step is to be able to insert a unicode sequence, such as
Quoting https://www.unicode.org/reports/tr9/
LRO U+202D LEFT-TO-RIGHT OVERRIDE Force following characters to be treated as strong left-to-right characters
End of quote. Immediately after the columns separator character, at each column, and at each row, of that column. And an
Quoting https://www.unicode.org/reports/tr9/
PDI U+2069 POP DIRECTIONAL ISOLATE End the scope of the last LRI, RLI, or FSI
End of quote. Immediately before the columns separator character, at each column, and at each row, of that column. - Hopefully, the above will isolate each row of each column, so that it could be treated separately from the other rows, and the other columns. And then see if the bidi layer of the terminal handle those rows without necessitating more intervention by MC. It would also set the construct, so that more people could see where to write additional code. Sort of hooks to add more patches.
If you can provide a patch that fixes RTL without breaking anything else, then we could try to help you to get it in.
As for a patch, and time, that is far beyond my ability.
All the best.
Same for you: all the best.
comment:22 in reply to: ↑ 20 Changed 3 years ago by ZGMxYWFh
Replying to andrew_b:
Replying to zaytsev:
so we don't really understand your problem
The problem is shown in the first screenshot.
As I wrote in comment:15, that is not the whole problem.
Note that in addition to the switching of the columns initially reported in this bug, the A letter, which should appear as part of the Aא file name, is adjacent to the 0 from the file size. And disjoint from the file name.
and can't provide help fixing it - we just don't have skills and/or time for it.
Unfortunately, that's true.
As I wrote in comment:21, that is partially wrong. The skills are there.
comment:23 Changed 3 years ago by ossi
- Cc dickey added
i think the correct pair would be FSI+PDI, see https://www.w3.org/International/questions/qa-bidi-unicode-controls for example.
anyway, the question would be how to get those characters into the stream, given that it's auto-generated by ncurses. i googled around a bit, but ncurses+bidi yields only open questions. i think it would need to gain an attribute bit for isolated text or something like that.
oh, and there is also the s-lang output backend (edit: which you're actually using) ...
comment:24 Changed 3 years ago by ZGMxYWFh
Two small notes, but not the real work.
(1) libraqm
I have came across libraqm. I only briefly skimmed its description. Nothing else. I believe it is used by imagemagick. I am not aware to any other usage. I don't know how libraqm compares to other, similar, libraries. In fact I don't know, and haven't searched for, similar libraries. Quoting the first line of its description
Raqm is a small library that encapsulates the logic for complex text layout and provides a convenient API.
(2) GLib Unicode Support
While staring at (1), I realized mc already depends on Glib. Which has a Unicode Support component. Which might already be in use by mc. Qouting Glib Unicode Support
Character properties such as ..., break type, ...
The words break type made me think it could be tightly related to the FSI+PDI, or whatever is required, by comment:23. I haven't pursued it further. Just a hunch I am putting on the table.
comment:25 Changed 11 months ago by andrew_b
Related to #4516.