[clug] Can't save from nano -> Ubuntu Unity

Scott Ferguson scott.ferguson.clug at gmail.com
Thu Apr 9 16:31:42 MDT 2015


On 10/04/15 00:48, Bryan Kilgallin wrote:
> Thanks, Scott:
> 
>> What should happen is that the menu should call mc in a new terminal
>> session (done with a .desktop file now-a-days).
> 
> I have reinstalled the MC icon in the Launcher.

That doesn't tell me the command/s being called by that menu entry. mc
alone won't do anything useful *unless* called in a terminal session.

If I do the KDE equivalent (press Alt+F2, type the first letters of a
command/application "mc" it will show the MC application, clicking on it
or pressing Enter) will simply run the mc command - which will fail
without being called in a terminal session).
If I open a terminal session and run the command mc it will function
properly (as it's a terminal application).
If I click on the MC entry in the Utility section of KMenu it will
launch mc in a terminal session and it will function properly. That's
because the KMenu uses the .desktop settings:-

mlocate mc.desktop
/usr/share/applications/mc.desktop

grep 'Exec\|Terminal' /usr/share/applications/mc.desktop
Exec=mc
Terminal=true

The last shows why the KDE menu entry works - it's calling mc *in* a
terminal session.


GNOME uses either xsession or gnome-terminal. So a menu entry for them
would use a .desktop file similar to the following:-

[Desktop Entry]
Name=MC
Comment=This session logs you into MC
Exec=gnome-terminal
TryExec=gnome-terminal
Icon=MidnightCommander
Type=Application


NOTE: I'm guessing. You should check the above with someone who actually
uses Ubuntu.

> 
> {The Unity user interface consists of several components:
> ^...
> ^<https://en.wikipedia.org/wiki/Unity_%28user_interface%29#cite_note-unity-terminology-10>
> 
> 
>  * *Launcher* – a dock
>    <https://en.wikipedia.org/wiki/Dock_%28computing%29> that also
>    serves as a window switcher. Multiple instances of an application
>    are grouped under the same dock icon, with a number of indicators to
>    the side of the icon showing how many instances are open.}
> 
> https://en.wikipedia.org/wiki/Unity_%28user_interface%29#User_interface
> 
>>   e.g. "konsole -e mc" - *but* you shouldn't get any "snippets".
> 
> I double-clicked on the MC icon in the Launcher. That opened an "mc"
> text-interface window. I dismissed the "User menu" dialogue list with
> [Esc]. In the left panel, I double-clicked "/Desktop". Then across the
> bottom of the right panel, appeared "Warning: cannot change to
> /home/<user>/Desktop.". Next I used the Options menu to turn on showing
> hidden files. Then in addition to the previous snippet at the bottom,
> across the middle near the top sprang "nge to /home/<user>/Desktop.". So
> now the mc window has accumulated two ghostly text snippets!
> 
>> 'Perhaps' you create an entry for mc, unaware that it needs to be
>> called by the terminal and used "mc" instead of "konsole -e mc" which
>> 'might' produce "snippets"?
> 
> Just to repeat what I had done to get there,

I'd prefer you just checked what I'd suggested if it's all the same to
you - your actions are meaningless without context. I don't/won't run
Ubuntu or GNOME so have no means (or desire) to try and duplicate your
experience. What 'seems' important is the result of the actions rather
than the actions themselves.

<snipped>
> 
> For comparison I give the example of double-clicking the ELinks Web
> browser's Launcher icon. Then a terminal window opens and and operates
> OK. It seems however that only "mc" is buggy when opened from the Unity
> Launcher!

Compare elinks.desktop to mc.desktop for evidence to support that suspicion.

> 
>> Try using "touch" to create the "test" file - *where* you want the
>> test file to live.
> 
> I'm puzzled. For in my terminal window I entered "apropos touch".
> Which then explained: "touch (1)            - change file timestamps".


apropos $package (find man files about related packages)

man $package (show man file for package)

man touch (would have told you about "touch")

touch 'can' change timestamps, however if called with a filename and no
options it simply creates an empty file.
e.g.:-
touch test.file (will create an empty file in the current directory
called test.file)
you 'could' then edit that file with "nano test.file" (which you could
also just type in the mc cli, or simply select it (if you've previously
created it with the touch command) in mc and press F4 to edit it.

Kind regards


More information about the linux mailing list