Ctrl-Enter for Midnight Commander not working in X terminals in Fedora, working in OpenSuse












-1















I like Midnight Commander. Might have to do with starting with DOS machines in the early 90s in Russia, but now I just really like the integration of the command line with a two-panel file list. And a key feature is that Ctrl+Enter copies the name of the currently selected file or directory into the command line, without starting it.



Unfortunately, on Fedora (26 and 27) this fails in Konsole and, apparemntly, in all other X-based terminals too. It does work in the virtual console I get py pressing Ctrl-Alt-F3.



On OpenSuse Leap (42.1, 42.2, 42.3) the Ctrl+Enter functionality works perfectly. And I could not work out any difference. (I use KDE on both, which, as far as I understand, means that on Fedora I have X.org, not Wayland).



How can I make Ctrl+Enter work on Fedora? Alternatively if this is impossible, is there a way to reassign the very useful functionality to some other key combination in Midnight Commander?



(I would also consider alternatives to Midnight Commander itself, but on;y those running in a console window, and it seems there aren't any. I don't need a graphical two-panel file manager, as I use MC to assist in crafting commands quickly).










share|improve this question





























    -1















    I like Midnight Commander. Might have to do with starting with DOS machines in the early 90s in Russia, but now I just really like the integration of the command line with a two-panel file list. And a key feature is that Ctrl+Enter copies the name of the currently selected file or directory into the command line, without starting it.



    Unfortunately, on Fedora (26 and 27) this fails in Konsole and, apparemntly, in all other X-based terminals too. It does work in the virtual console I get py pressing Ctrl-Alt-F3.



    On OpenSuse Leap (42.1, 42.2, 42.3) the Ctrl+Enter functionality works perfectly. And I could not work out any difference. (I use KDE on both, which, as far as I understand, means that on Fedora I have X.org, not Wayland).



    How can I make Ctrl+Enter work on Fedora? Alternatively if this is impossible, is there a way to reassign the very useful functionality to some other key combination in Midnight Commander?



    (I would also consider alternatives to Midnight Commander itself, but on;y those running in a console window, and it seems there aren't any. I don't need a graphical two-panel file manager, as I use MC to assist in crafting commands quickly).










    share|improve this question



























      -1












      -1








      -1








      I like Midnight Commander. Might have to do with starting with DOS machines in the early 90s in Russia, but now I just really like the integration of the command line with a two-panel file list. And a key feature is that Ctrl+Enter copies the name of the currently selected file or directory into the command line, without starting it.



      Unfortunately, on Fedora (26 and 27) this fails in Konsole and, apparemntly, in all other X-based terminals too. It does work in the virtual console I get py pressing Ctrl-Alt-F3.



      On OpenSuse Leap (42.1, 42.2, 42.3) the Ctrl+Enter functionality works perfectly. And I could not work out any difference. (I use KDE on both, which, as far as I understand, means that on Fedora I have X.org, not Wayland).



      How can I make Ctrl+Enter work on Fedora? Alternatively if this is impossible, is there a way to reassign the very useful functionality to some other key combination in Midnight Commander?



      (I would also consider alternatives to Midnight Commander itself, but on;y those running in a console window, and it seems there aren't any. I don't need a graphical two-panel file manager, as I use MC to assist in crafting commands quickly).










      share|improve this question
















      I like Midnight Commander. Might have to do with starting with DOS machines in the early 90s in Russia, but now I just really like the integration of the command line with a two-panel file list. And a key feature is that Ctrl+Enter copies the name of the currently selected file or directory into the command line, without starting it.



      Unfortunately, on Fedora (26 and 27) this fails in Konsole and, apparemntly, in all other X-based terminals too. It does work in the virtual console I get py pressing Ctrl-Alt-F3.



      On OpenSuse Leap (42.1, 42.2, 42.3) the Ctrl+Enter functionality works perfectly. And I could not work out any difference. (I use KDE on both, which, as far as I understand, means that on Fedora I have X.org, not Wayland).



      How can I make Ctrl+Enter work on Fedora? Alternatively if this is impossible, is there a way to reassign the very useful functionality to some other key combination in Midnight Commander?



      (I would also consider alternatives to Midnight Commander itself, but on;y those running in a console window, and it seems there aren't any. I don't need a graphical two-panel file manager, as I use MC to assist in crafting commands quickly).







      fedora terminal opensuse konsole mc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 3 '18 at 14:27









      egmont

      2,6821912




      2,6821912










      asked Jan 3 '18 at 2:43









      Mikhail RamendikMikhail Ramendik

      19610




      19610






















          2 Answers
          2






          active

          oldest

          votes


















          3














          tl;dr: Get used to Alt+Enter (a.k.a. ESC followed by Enter) instead.



          Ctrl+Enter generates the exact same sequence in terminal emulators as Enter, so there's no way for an app to distinguish these two. Well, no way by looking at the input stream it receives from the terminal emulator.



          mc has an interesting feature called "X11 support". It does not only look at the bytes it receives from the terminal emulator, but (if this support is compiled in, and if X11 connection is available runtime) queries the X11 server for the state of the modifier keys.



          So basically it goes like: "Wow, I received an Enter from the terminal emulator. Hey, X11 server, is Ctrl pressed now?"



          There are multiple ways this might not work for you.



          Fedora's mc may have been compiled without X11 support, I don't know. Check the output of mc --version, does it contain "With support for X11 events"?



          su, sudo, screen, tmux, ssh or similar tools can also break this functionality in case the X11 connection isn't available inside them (e.g. credentials not properly set up / forwarded by su or sudo; screen or tmux being detached and reattached from another X server; display not forwarded by ssh).



          The feature doesn't work on Wayland either. I suspect it cannot be implemented in Wayland due to its security model, or at least not without some plugin/extension to some core Wayland component. But even if the state of modifiers could be detected, it's not yet done in mc.






          share|improve this answer
























          • Thanks! Alt+Enter works and that's enough for me right now.

            – Mikhail Ramendik
            Jan 3 '18 at 14:29





















          0














          We still don't have a replacement for Ctrl-Shift-Enter in MC on Wayland.



          So lacking one, I suggest to use Alt-m instead. And because Enter is the same as Ctrl-m, this means we would have:





          • Alt-Ctrl-m, ie. Alt-Enter, for Paste file name.


          • Alt-m for Paste full path name.


          Note that by default Alt-m is assigned to the Mail action, so we will lose that mapping but it looks like a winning deal.



          Here a (replayable) script to apply this new mapping in the default keymap (file /etc/mc/mc.keymap):



          sudo sed -ri '/PutCurrentFullSelected/s/=( alt-m;)?/= alt-m;/' /etc/mc/mc.default.keymap
          sudo sed -ri '/Mail = alt-m/s/= alt-m/=/;' /etc/mc/mc.default.keymap


          Or the patch:



          diff --git a/mc/mc.default.keymap b/mc/mc.default.keymap
          --- a/mc/mc.default.keymap
          +++ b/mc/mc.default.keymap
          @@ -33,7 +33,7 @@ Shell = ctrl-o
          PutCurrentPath = alt-a
          PutOtherPath = alt-shift-a
          PutCurrentSelected = alt-enter; ctrl-enter
          -PutCurrentFullSelected = ctrl-shift-enter
          +PutCurrentFullSelected = alt-m; ctrl-shift-enter
          ViewFiltered = alt-exclamation
          Select = kpplus
          Unselect = kpminus
          @@ -313,7 +313,7 @@ Help = f1
          Refresh = ctrl-l
          Goto = alt-l
          Sort = alt-t
          -Mail = alt-m
          +Mail =
          ParagraphFormat = alt-p
          MatchBracket = alt-b
          ExternalCommand = alt-u





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414413%2fctrl-enter-for-midnight-commander-not-working-in-x-terminals-in-fedora-working%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            tl;dr: Get used to Alt+Enter (a.k.a. ESC followed by Enter) instead.



            Ctrl+Enter generates the exact same sequence in terminal emulators as Enter, so there's no way for an app to distinguish these two. Well, no way by looking at the input stream it receives from the terminal emulator.



            mc has an interesting feature called "X11 support". It does not only look at the bytes it receives from the terminal emulator, but (if this support is compiled in, and if X11 connection is available runtime) queries the X11 server for the state of the modifier keys.



            So basically it goes like: "Wow, I received an Enter from the terminal emulator. Hey, X11 server, is Ctrl pressed now?"



            There are multiple ways this might not work for you.



            Fedora's mc may have been compiled without X11 support, I don't know. Check the output of mc --version, does it contain "With support for X11 events"?



            su, sudo, screen, tmux, ssh or similar tools can also break this functionality in case the X11 connection isn't available inside them (e.g. credentials not properly set up / forwarded by su or sudo; screen or tmux being detached and reattached from another X server; display not forwarded by ssh).



            The feature doesn't work on Wayland either. I suspect it cannot be implemented in Wayland due to its security model, or at least not without some plugin/extension to some core Wayland component. But even if the state of modifiers could be detected, it's not yet done in mc.






            share|improve this answer
























            • Thanks! Alt+Enter works and that's enough for me right now.

              – Mikhail Ramendik
              Jan 3 '18 at 14:29


















            3














            tl;dr: Get used to Alt+Enter (a.k.a. ESC followed by Enter) instead.



            Ctrl+Enter generates the exact same sequence in terminal emulators as Enter, so there's no way for an app to distinguish these two. Well, no way by looking at the input stream it receives from the terminal emulator.



            mc has an interesting feature called "X11 support". It does not only look at the bytes it receives from the terminal emulator, but (if this support is compiled in, and if X11 connection is available runtime) queries the X11 server for the state of the modifier keys.



            So basically it goes like: "Wow, I received an Enter from the terminal emulator. Hey, X11 server, is Ctrl pressed now?"



            There are multiple ways this might not work for you.



            Fedora's mc may have been compiled without X11 support, I don't know. Check the output of mc --version, does it contain "With support for X11 events"?



            su, sudo, screen, tmux, ssh or similar tools can also break this functionality in case the X11 connection isn't available inside them (e.g. credentials not properly set up / forwarded by su or sudo; screen or tmux being detached and reattached from another X server; display not forwarded by ssh).



            The feature doesn't work on Wayland either. I suspect it cannot be implemented in Wayland due to its security model, or at least not without some plugin/extension to some core Wayland component. But even if the state of modifiers could be detected, it's not yet done in mc.






            share|improve this answer
























            • Thanks! Alt+Enter works and that's enough for me right now.

              – Mikhail Ramendik
              Jan 3 '18 at 14:29
















            3












            3








            3







            tl;dr: Get used to Alt+Enter (a.k.a. ESC followed by Enter) instead.



            Ctrl+Enter generates the exact same sequence in terminal emulators as Enter, so there's no way for an app to distinguish these two. Well, no way by looking at the input stream it receives from the terminal emulator.



            mc has an interesting feature called "X11 support". It does not only look at the bytes it receives from the terminal emulator, but (if this support is compiled in, and if X11 connection is available runtime) queries the X11 server for the state of the modifier keys.



            So basically it goes like: "Wow, I received an Enter from the terminal emulator. Hey, X11 server, is Ctrl pressed now?"



            There are multiple ways this might not work for you.



            Fedora's mc may have been compiled without X11 support, I don't know. Check the output of mc --version, does it contain "With support for X11 events"?



            su, sudo, screen, tmux, ssh or similar tools can also break this functionality in case the X11 connection isn't available inside them (e.g. credentials not properly set up / forwarded by su or sudo; screen or tmux being detached and reattached from another X server; display not forwarded by ssh).



            The feature doesn't work on Wayland either. I suspect it cannot be implemented in Wayland due to its security model, or at least not without some plugin/extension to some core Wayland component. But even if the state of modifiers could be detected, it's not yet done in mc.






            share|improve this answer













            tl;dr: Get used to Alt+Enter (a.k.a. ESC followed by Enter) instead.



            Ctrl+Enter generates the exact same sequence in terminal emulators as Enter, so there's no way for an app to distinguish these two. Well, no way by looking at the input stream it receives from the terminal emulator.



            mc has an interesting feature called "X11 support". It does not only look at the bytes it receives from the terminal emulator, but (if this support is compiled in, and if X11 connection is available runtime) queries the X11 server for the state of the modifier keys.



            So basically it goes like: "Wow, I received an Enter from the terminal emulator. Hey, X11 server, is Ctrl pressed now?"



            There are multiple ways this might not work for you.



            Fedora's mc may have been compiled without X11 support, I don't know. Check the output of mc --version, does it contain "With support for X11 events"?



            su, sudo, screen, tmux, ssh or similar tools can also break this functionality in case the X11 connection isn't available inside them (e.g. credentials not properly set up / forwarded by su or sudo; screen or tmux being detached and reattached from another X server; display not forwarded by ssh).



            The feature doesn't work on Wayland either. I suspect it cannot be implemented in Wayland due to its security model, or at least not without some plugin/extension to some core Wayland component. But even if the state of modifiers could be detected, it's not yet done in mc.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 3 '18 at 9:10









            egmontegmont

            2,6821912




            2,6821912













            • Thanks! Alt+Enter works and that's enough for me right now.

              – Mikhail Ramendik
              Jan 3 '18 at 14:29





















            • Thanks! Alt+Enter works and that's enough for me right now.

              – Mikhail Ramendik
              Jan 3 '18 at 14:29



















            Thanks! Alt+Enter works and that's enough for me right now.

            – Mikhail Ramendik
            Jan 3 '18 at 14:29







            Thanks! Alt+Enter works and that's enough for me right now.

            – Mikhail Ramendik
            Jan 3 '18 at 14:29















            0














            We still don't have a replacement for Ctrl-Shift-Enter in MC on Wayland.



            So lacking one, I suggest to use Alt-m instead. And because Enter is the same as Ctrl-m, this means we would have:





            • Alt-Ctrl-m, ie. Alt-Enter, for Paste file name.


            • Alt-m for Paste full path name.


            Note that by default Alt-m is assigned to the Mail action, so we will lose that mapping but it looks like a winning deal.



            Here a (replayable) script to apply this new mapping in the default keymap (file /etc/mc/mc.keymap):



            sudo sed -ri '/PutCurrentFullSelected/s/=( alt-m;)?/= alt-m;/' /etc/mc/mc.default.keymap
            sudo sed -ri '/Mail = alt-m/s/= alt-m/=/;' /etc/mc/mc.default.keymap


            Or the patch:



            diff --git a/mc/mc.default.keymap b/mc/mc.default.keymap
            --- a/mc/mc.default.keymap
            +++ b/mc/mc.default.keymap
            @@ -33,7 +33,7 @@ Shell = ctrl-o
            PutCurrentPath = alt-a
            PutOtherPath = alt-shift-a
            PutCurrentSelected = alt-enter; ctrl-enter
            -PutCurrentFullSelected = ctrl-shift-enter
            +PutCurrentFullSelected = alt-m; ctrl-shift-enter
            ViewFiltered = alt-exclamation
            Select = kpplus
            Unselect = kpminus
            @@ -313,7 +313,7 @@ Help = f1
            Refresh = ctrl-l
            Goto = alt-l
            Sort = alt-t
            -Mail = alt-m
            +Mail =
            ParagraphFormat = alt-p
            MatchBracket = alt-b
            ExternalCommand = alt-u





            share|improve this answer




























              0














              We still don't have a replacement for Ctrl-Shift-Enter in MC on Wayland.



              So lacking one, I suggest to use Alt-m instead. And because Enter is the same as Ctrl-m, this means we would have:





              • Alt-Ctrl-m, ie. Alt-Enter, for Paste file name.


              • Alt-m for Paste full path name.


              Note that by default Alt-m is assigned to the Mail action, so we will lose that mapping but it looks like a winning deal.



              Here a (replayable) script to apply this new mapping in the default keymap (file /etc/mc/mc.keymap):



              sudo sed -ri '/PutCurrentFullSelected/s/=( alt-m;)?/= alt-m;/' /etc/mc/mc.default.keymap
              sudo sed -ri '/Mail = alt-m/s/= alt-m/=/;' /etc/mc/mc.default.keymap


              Or the patch:



              diff --git a/mc/mc.default.keymap b/mc/mc.default.keymap
              --- a/mc/mc.default.keymap
              +++ b/mc/mc.default.keymap
              @@ -33,7 +33,7 @@ Shell = ctrl-o
              PutCurrentPath = alt-a
              PutOtherPath = alt-shift-a
              PutCurrentSelected = alt-enter; ctrl-enter
              -PutCurrentFullSelected = ctrl-shift-enter
              +PutCurrentFullSelected = alt-m; ctrl-shift-enter
              ViewFiltered = alt-exclamation
              Select = kpplus
              Unselect = kpminus
              @@ -313,7 +313,7 @@ Help = f1
              Refresh = ctrl-l
              Goto = alt-l
              Sort = alt-t
              -Mail = alt-m
              +Mail =
              ParagraphFormat = alt-p
              MatchBracket = alt-b
              ExternalCommand = alt-u





              share|improve this answer


























                0












                0








                0







                We still don't have a replacement for Ctrl-Shift-Enter in MC on Wayland.



                So lacking one, I suggest to use Alt-m instead. And because Enter is the same as Ctrl-m, this means we would have:





                • Alt-Ctrl-m, ie. Alt-Enter, for Paste file name.


                • Alt-m for Paste full path name.


                Note that by default Alt-m is assigned to the Mail action, so we will lose that mapping but it looks like a winning deal.



                Here a (replayable) script to apply this new mapping in the default keymap (file /etc/mc/mc.keymap):



                sudo sed -ri '/PutCurrentFullSelected/s/=( alt-m;)?/= alt-m;/' /etc/mc/mc.default.keymap
                sudo sed -ri '/Mail = alt-m/s/= alt-m/=/;' /etc/mc/mc.default.keymap


                Or the patch:



                diff --git a/mc/mc.default.keymap b/mc/mc.default.keymap
                --- a/mc/mc.default.keymap
                +++ b/mc/mc.default.keymap
                @@ -33,7 +33,7 @@ Shell = ctrl-o
                PutCurrentPath = alt-a
                PutOtherPath = alt-shift-a
                PutCurrentSelected = alt-enter; ctrl-enter
                -PutCurrentFullSelected = ctrl-shift-enter
                +PutCurrentFullSelected = alt-m; ctrl-shift-enter
                ViewFiltered = alt-exclamation
                Select = kpplus
                Unselect = kpminus
                @@ -313,7 +313,7 @@ Help = f1
                Refresh = ctrl-l
                Goto = alt-l
                Sort = alt-t
                -Mail = alt-m
                +Mail =
                ParagraphFormat = alt-p
                MatchBracket = alt-b
                ExternalCommand = alt-u





                share|improve this answer













                We still don't have a replacement for Ctrl-Shift-Enter in MC on Wayland.



                So lacking one, I suggest to use Alt-m instead. And because Enter is the same as Ctrl-m, this means we would have:





                • Alt-Ctrl-m, ie. Alt-Enter, for Paste file name.


                • Alt-m for Paste full path name.


                Note that by default Alt-m is assigned to the Mail action, so we will lose that mapping but it looks like a winning deal.



                Here a (replayable) script to apply this new mapping in the default keymap (file /etc/mc/mc.keymap):



                sudo sed -ri '/PutCurrentFullSelected/s/=( alt-m;)?/= alt-m;/' /etc/mc/mc.default.keymap
                sudo sed -ri '/Mail = alt-m/s/= alt-m/=/;' /etc/mc/mc.default.keymap


                Or the patch:



                diff --git a/mc/mc.default.keymap b/mc/mc.default.keymap
                --- a/mc/mc.default.keymap
                +++ b/mc/mc.default.keymap
                @@ -33,7 +33,7 @@ Shell = ctrl-o
                PutCurrentPath = alt-a
                PutOtherPath = alt-shift-a
                PutCurrentSelected = alt-enter; ctrl-enter
                -PutCurrentFullSelected = ctrl-shift-enter
                +PutCurrentFullSelected = alt-m; ctrl-shift-enter
                ViewFiltered = alt-exclamation
                Select = kpplus
                Unselect = kpminus
                @@ -313,7 +313,7 @@ Help = f1
                Refresh = ctrl-l
                Goto = alt-l
                Sort = alt-t
                -Mail = alt-m
                +Mail =
                ParagraphFormat = alt-p
                MatchBracket = alt-b
                ExternalCommand = alt-u






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                fuujuhifuujuhi

                11




                11






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414413%2fctrl-enter-for-midnight-commander-not-working-in-x-terminals-in-fedora-working%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Histoire des bourses de valeurs

                    Why is there Russian traffic in my log files?

                    Rename multiple files to decrement number in file name?