When I "updated my Lubuntu 18.04 today, Weds, Oct 21, it gave me the option to upgrade to 20.04, which I casually accepted, however, since then /bin/ksh has not done command line editing. I have re-installed several different ksh versions, with the most recent ones claiming function with Lubuntu 20.04, but named mksh, or pdksh, but still to no avail. How can I best restore ksh’s command line editing functionality?
Ok, first thing’s first: that particular upgrade means you have essentially two completely different desktop environments and application sets. The relevance here is that you have multiple desktop environments (LXDE for 18.04 and LXQt for 20.04) and multiple terminals (lxterminal for 18.04 and qterminal for 20.04). So we need to know which session and which terminal you’re using. You could potentially eliminate the variable here by using a virtual terminal.
Secondly, command line editing is based on the value of the
VISUAL variable. What do you have it set to? If it’s null, there’s your problem. If you have it set to emacs or vi, that’s not a problem, but the remaining question would be how you’re trying to initiate command line editing.
And also, is the issue that it doesn’t enter edit mode or that the editing keys themselves don’t work?
tl;dr more details, please.
I do greatly appreciate your reply, thank-you, I hope I can answer your questions and make progress here. I can only run one OS, and it says 20.04 on the background screen, so I assume I am in LXQt for 20.04. I have used the lxterminal in 20.04, as well as typing ctrl-alt-T (I think thats it) to get a terminal, but both have the ksh problem. I am quite familiar with the VISUAL variable requirements for ksh, having used it since my days at AT&T bell labs where it was originally developed, so I have set that, as well as the EDITOR variable, which worked in older versions of ksh.
Usually command line editing starts with vi’s “escape” key, putting me into command mode, but that has no effect, esc-k usually showed the last line, but it shows nothing.
Sometimes I can do esc-k, with nothing happening, sometimes, I need to hit return to resume typing normal command lines, without the editing ability.
The value of
XDG_CURRENT_DESKTOP will tell you which deskop environment you’re in.
I would suggest opening the menu and specifically running lxterminal and (note: not “or”) qterminal manually to ensure you’re using the right thing. See if there is consistency here.
You explain that you know about the environment variables required, but you did not say whether or not you checked their values inside the terminal you’re using, so you might think you have them set when you don’t.
Also I mentioned using a virtual terminal (Ctrl-Alt-F3, e.g.).
I have done echo $VISUAL several times, to confirm it is set. A .profile for ksh, which I . .profile explicitly has been setting it for me. The menu versio of the lxterminal is the lxterminal I have normally run, and is the first terminal in which I noticed this problem.
I have now tried the virtual terminal, Ctrl-Alt-F3, and it fails the same way. But now I don’t know how to exit, or quit the full screen virtual terminal? Can you tell me how that works?
at least from the virtual terminal, the environment variable: $XDG_CURRENT_DESKTOP has no value. I assume you were referring to an environment variable with that, right?
I am still stuck in the virtual terminal, which grossly limits all I can do. I cannot refer to any menus because it controls the screen, but unlike other terminals, when I type exit, it just gives me a prompt for a new user, and remains on the screen.
Ctrl-Alt-F1 or Ctrl-Alt-F7 should get you back.
If you’re looking at that environment variable in a virtual terminal, I’m not sure it will show you anything.
Anyways I just booted a live image of 20.04, installed ksh, opened qterminal, executed
export VISUAL=vi and then
something and hit Escape and was able to use
l to navigate across the word as expected, so I can’t reproduce your issue.
So we know the issue is not 20.04. I could try booting 18.04 and upgrading to 20.04, but that will not only take a while, but even if we discover the issue there, the recommended solution is still the same: a fresh install of 20.04.
There are 7 other XDG env variables define:
XDG variables define the desktop environment, so you’ll always have lots of them. Irrelevant.
Agreed, but thanks, the ctrl-alt-F7 got me back, (F1 only got back to the username prompt).
So yes, in an lxtermina, the ENV has more XDG variables, and XDG_CURRENT_DESKTOP=LXQt
Thanks also for confirming the fresh install is of 20.04, not of ksh, Is there place I can go to do that, I only clicked on the “upgrade” button this morning
You download the installation media and use your computer to boot it, just as you did the first time you installed Lubuntu.
someone else did the original install for me, I only clicked the upgrade today, so I need a little more on where I can download the install media?
The release notes include links to downloads, as well as general instructions, etc.
P.S. Before you go too far, you might want to try to
sudo apt install --reinstall ksh since that might help (an aside: the various ksh packages shouldn’t necessarily be considered compatible or equivalent). Also maybe move the .profile somewhere else. It’s possible that something you have set there is incompatible with the current version of ksh and is resulting in this strange behavior. Since 18.04, ksh went through some major changes (and I should add to this discussion that when I say “ksh” I mean the ksh package, not any of the other ones).
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.