Wences
Posts: 2
Joined: Fri May 29, 2020 9:15 pm

Two text editors?

Fri May 29, 2020 9:47 pm

I woke up my Pi to use and saw there is two text editors installed today after an update. Mousepad and leafpad. Why this happened?

User avatar
Botspot
Posts: 1235
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Two text editors?

Sat May 30, 2020 1:53 pm

It's been that way for a while.
Mousepad is better than leafpad. (more features)
Unfortunately, many tutorials expect users to have leafpad installed, and since latest Raspberry Pi OS doesn't have it, they are confused.

Go ahead and uninstall leafpad, and I suggest you create a symlink just in case a script tries to run leafpad:

Code: Select all

sudo ln -s /usr/bin/mousepad /usr/bin/leafpad
So now if you try to run leafpad, it will really run mousepad. :)
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

User avatar
B.Goode
Posts: 10091
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Two text editors?

Sat May 30, 2020 2:21 pm

Wences wrote:
Fri May 29, 2020 9:47 pm
I woke up my Pi to use and saw there is two text editors installed today after an update. Mousepad and leafpad. Why this happened?

There are also multiple web browsers, multiple python interpreters, multiple implementations of Scratch, probably multiples of lots of other things? What makes you think having a choice of editors is a problem?

User avatar
Botspot
Posts: 1235
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Two text editors?

Sat May 30, 2020 2:28 pm

B.Goode wrote:
Sat May 30, 2020 2:21 pm
What makes you think having a choice of editors is a problem?
Curiosity, most likely.
I was curious too. ;)
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

Heater
Posts: 15778
Joined: Tue Jul 17, 2012 3:02 pm

Re: Two text editors?

Sat May 30, 2020 2:28 pm

What I want to know is why an update would download and install a program that was not installed before and I did not ask for?

That is the kind of underhanded behavior we expect of Windows or Android, not a proper operating system.
Memory in C++ is a leaky abstraction .

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Two text editors?

Sat May 30, 2020 2:39 pm

About a decade ago, apt gained a misfeature called install-recommends that's on by default. And there's also install-suggests, which installs 'Suggested packages' (although that's off by default). Could something have updated that has pulled in the second text editor via one of those mechanisms?

Not that you need such a thing. vim -- barring idiotic mouse support -- does everything required.

jahboater
Posts: 5632
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Two text editors?

Sat May 30, 2020 2:45 pm

dickon wrote:
Sat May 30, 2020 2:39 pm
Not that you need such a thing. vim -- barring idiotic mouse support -- does everything required.
emacs does everything required! :)
Pi4 8GB running PIOS64

W. H. Heydt
Posts: 12326
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Two text editors?

Sat May 30, 2020 5:29 pm

Not just those... ed and ex are also there (by default). Those, particularly ed, are the "go to" editors for OMG...the full screen stuff isn't working.

jahboater
Posts: 5632
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Two text editors?

Sat May 30, 2020 5:43 pm

The most popular editor (also included by default in PIOS) is probably nano.
Pi4 8GB running PIOS64

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Two text editors?

Sat May 30, 2020 5:46 pm

Ghastly thing. I hate it.

Heater
Posts: 15778
Joined: Tue Jul 17, 2012 3:02 pm

Re: Two text editors?

Sat May 30, 2020 5:53 pm

Nano is not popular. Who would spend all their time writing code or novels in nano?

It's there as an essential tool, for those who never figured out how to exit vim, for when your OS is in a mess and nothing GUI works or you are connecting over ssh and such.
Memory in C++ is a leaky abstraction .

bls
Posts: 586
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: Two text editors?

Sat May 30, 2020 5:55 pm

The only good thing you can say about nano is that it's there by default, even on Raspbian Lite. Of course, the first thing I do is installed the best of breed editor, emacs. :roll:
Super-useful tools:
RPi SD Card Manager: https://github.com/gitbls/sdm
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo
Easy-Peasy VPN installer/manager: https://github.com/gitbls/pistrong

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Two text editors?

Sat May 30, 2020 6:03 pm

The first thing I do when accidentally coming across it -- crontab editing, for example -- is quit it, and blow the damned thing away with a --purge. The *one* thing it has going for it, as far as I'm concerned, is that you can explain to a user how to drive it over the phone in extremis, and the instructions for quitting it are at the bottom of the screen. It's actually easier to talk someone through vi, if you have the file they're editing infront of you, but explaining that vi is modal, has two modes, they're called 'beep mode' and 'corrupt mode', and you switch from 'beep' to 'corrupt' by pressing various letters (but not others, which just beep at you), and 'corrupt' back to 'beep' by pressing escape, gets tedious the Nth time you've done it, for surprisingly small N.

W. H. Heydt
Posts: 12326
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Two text editors?

Sat May 30, 2020 6:09 pm

dickon wrote:
Sat May 30, 2020 5:46 pm
Ghastly thing. I hate it.
A good reason for noting quite a range of other choices. Not merely the two that OP wondered at.

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Two text editors?

Sat May 30, 2020 6:10 pm

Entirely agreed. I just wish it wasn't the default.

W. H. Heydt
Posts: 12326
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Two text editors?

Sat May 30, 2020 6:15 pm

dickon wrote:
Sat May 30, 2020 6:03 pm
The first thing I do when accidentally coming across it -- crontab editing, for example -- is quit it, and blow the damned thing away with a --purge. The *one* thing it has going for it, as far as I'm concerned, is that you can explain to a user how to drive it over the phone in extremis, and the instructions for quitting it are at the bottom of the screen. It's actually easier to talk someone through vi, if you have the file they're editing infront of you, but explaining that vi is modal, has two modes, they're called 'beep mode' and 'corrupt mode', and you switch from 'beep' to 'corrupt' by pressing various letters (but not others, which just beep at you), and 'corrupt' back to 'beep' by pressing escape, gets tedious the Nth time you've done it, for surprisingly small N.
My wife *has* written entire novels using vi as the editor and coding the formatting using the -ms macro package, printing out the manuscript with nroff. (To be fair, as a description of skill, she also edited a UC Berkeley training document on using the -ms macro package, here https://www.hactrn.net/ietf/rfcgen/textms.html for anyone interested. )

bjtheone
Posts: 699
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Two text editors?

Sat May 30, 2020 8:50 pm

W. H. Heydt wrote:
Sat May 30, 2020 5:29 pm
Not just those... ed and ex are also there (by default). Those, particularly ed, are the "go to" editors for OMG...the full screen stuff isn't working.
I still have flashbacks to a fairly ghastly time when we had a programming course in university and they would not give lowly undergrads access to a full screen editor, due to the low it imposed on the system. Ed on a nasty vc404..... Was thrilled when I could dial into the university on a 1200 baud modem and run a decent terminal emulator on my PC clone. Plus I could check my code without having to wait for the batch compiles to come back.

Ed is not a nice editor. Vi is so much better for when you don't need a real editor (emacs).

W. H. Heydt
Posts: 12326
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Two text editors?

Sat May 30, 2020 9:29 pm

bjtheone wrote:
Sat May 30, 2020 8:50 pm
W. H. Heydt wrote:
Sat May 30, 2020 5:29 pm
Not just those... ed and ex are also there (by default). Those, particularly ed, are the "go to" editors for OMG...the full screen stuff isn't working.
I still have flashbacks to a fairly ghastly time when we had a programming course in university and they would not give lowly undergrads access to a full screen editor, due to the low it imposed on the system. Ed on a nasty vc404..... Was thrilled when I could dial into the university on a 1200 baud modem and run a decent terminal emulator on my PC clone. Plus I could check my code without having to wait for the batch compiles to come back.

Ed is not a nice editor. Vi is so much better for when you don't need a real editor (emacs).
I don't want to start a war here, but since I already have a kitchen sink, I don't need emacs.

Now, to be fair, in the vast number of cases, ones favorite editor is generally the first one learned. So if you first learn emacs, that will be your choice. Likewise, if one first learns vi, that will be the preferred editor. As it happen, I learned vi, so that is my "go to" editor. One of the first things I do when installing a new OS on a Pi is go into /etc/profile and at a line saying "export EDITOR=/usr/bin/vi". After the next reboot, the world conforms to my expectations.

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Two text editors?

Sat May 30, 2020 9:50 pm

We had a thing at my second workplace[0]: everything plausible on desktops, but system tools only on production machines. That was Solaris (both). Solaris doesn't come with emacs (certainly not on a server install), so learn vi if you don't already know it as you're going to be lost otherwise.

We did OK. I'd dumped Pico for vim (and Pine[2] for Elm[1]) back at Uni, so had no trouble...

[0] BBC Internet Services, a team within BBC R&D when I joined it.
[1] ELectronic Mail
[2] Pine Is Not Elm

Wences
Posts: 2
Joined: Fri May 29, 2020 9:15 pm

Re: Two text editors?

Sun May 31, 2020 1:40 am

I was curious and it was strange, because I think my Raspbian only had leafpad, but now it also had mousepad even though I did not install it myself. I have automatic updates (apt update && apt full-upgrade) through a crontab, but I was wondering why a new text editor was added without my request. If mousepad is new replacement I understand, but I read like it was already default, so why my default was leafpad before. I am on buster.

Return to “General discussion”