yangzhong-freebsd / lua-httpd

13 stars 1 forks source link

Ask whether the default system-wide editor should be ee or vi #3

Open grahamperrin opened 3 years ago

grahamperrin commented 3 years ago

Implementation

Something like this:


Which command-line editor should be the system-wide default?

This system-wide default will apply to sh.

Per-user defaults for other shells may be set after starting the installed system.


Use a radio button GUI.

šŸ”˜ ee pre-selected.

If the user does not know: assume that they have no knowledge of vi, proceed as if ee was selected.

If the system-wide default will be ee, then append these two lines to /etc/profile:

export EDITOR=/usr/bin/ee
export VISUAL=/usr/bin/ee

Rationale

Essentially:

With a fresh installation of FreeBSD 13.0-RELEASE, echo $EDITOR returns vi.

For some newcomers to the system, unexpected/unwanted appearance of vi will be unreasonably disorienting.

Contexts include:

Problems with accidental/unexpected appearance of vi were acknowledged, in FreeBSD base, twenty years ago.

Earlier (twenty-four years ago):

ā€¦ vi ā€¦ sometimes you will inadvertently issue a command that will do something you do not expect. ā€¦ when it gives you trouble ā€¦

Thoughts

Compare with https://github.com/helloSystem/ISO/commit/a59de6af82bb52f6d91053896e052f31fce44901#diff-0f711ba9ca1c5db6bee04e1572b1f3ddf469a1f53b2348a70f34cb94d9a32baeR142 where no choice is offered and nano is the default. Whilst nano is reasonable for helloSystem, it is not in FreeBSD base.

FreeBSD base includes a handful of editors, of which ee seems to be the easiest (for people who will have little or no knowledge of vi).

fat-git-geezer commented 3 years ago

FCP-20211005-ee: Default Editor As ee


The default editor is an essential tool for the initial configuration of Freebsd. This should be easy to use both for seasoned users and new users.

Problem Statement


Many new users and some seasoned users have difficulty with vi, the current default editor. It is not self explanatory. Initial configuration of a new installation of Freebsd can entail all of

Currently this is highly difficult without a reasonable knowledge of vi.

Problem Discussion


Both ee and vi are in the base system.

The most basic requirements of a text editor are

vi has historically been the default editor, is a good text editor and has a long following of users who are satisfied. vi requires some knowledge of usage in order to save and exit.

ee as its name is an easy text editor. It requires no knowledge of usage for any of the basic requirements. This is because instructions are clearly displayed at the top of the screen and in menus.

Although it may be quite easy to change the EDITOR environment variable, it is not uncommon to have started the default editor beforehand, by for instance using chpass to change the default shell. This may alter the format of setting an environment variable in the first place.

During a fresh installation of Freebsd, many experienced users find the current default text editor of vi difficult, and the process of replacing it convoluted. Many new users have found themselves lost in vi, unable to save or exit.

This is offputting to new users of Freebsd, and as so may narrow the user-base of Freebsd.

Proposed Solution


The default editor should be changed from vi to ee.

Solution Discussion


ee is self explanatory and allows for full functionality of a text editor for those with no prior knowledge.

The default editor of ee would be forward thinking, modern and one step towards broadening the usage of Freebsd.

In recognition of those who prefer vi, vi should remain in the base system.

ee should also be added to /rescue.

Thank you.


grahamperrin commented 3 years ago

Food for thought, part of the NomadBSD first run routine:

image

fat-git-geezer commented 3 years ago

It is interesting to see that they give the choice of text editor both in text mode and in graphics mode. It is also interesting that they give the choice of shell in text mode and file manager in graphics mode.

I do not think that graphics mode should be mandatory in Freebsd as it appears to be in Nomadbsd. But it does show that they understand the essentials of a basic environment, editor and shell, which includes the options of ee and sh.

Vull-the-invisible commented 3 years ago

It would be fine with me if the default editor in FreeBSD was ee instead of vi. Anything to make things easier.

I agree that graphics should not be a mandatory part of FreeBSD. Many valid FreeBSD applications do not require graphics.

grahamperrin commented 2 years ago

append these two lines to /etc/profile:

In a helloSystem context, those lines were insufficient: https://www.reddit.com/r/freebsd/comments/xbycd8/-/io2fofz/.

fat-git-geezer commented 2 years ago

Great commit, +1 for common sense.

grahamperrin commented 2 years ago

Great commit, +1 for common sense.

Thanks, although let's note that it's essentially a draft in my fork (not in the FreeBSD repo, https://cgit.freebsd.org/src/). Testing the waters: https://old.reddit.com/r/freebsd/comments/xbycd8/-/io2od72/?context=1