pkg info -D mc
mc-4.8.30:
On install:
Midnight Commander was built with subshell support, which works with most
popular shells, e.g. bash(1), dash(1), tcsh(1), zsh(1), but not sh(1) due
to its lack of "precmd" or equivalent hooks which mc(1) needs to read the
subshell's current directory.
$ env SHELL=/bin/sh mc
common.c: unimplemented subshell type 1
read (subshell_pty...): No such file or directory (2)
Please either use more advanced interactive shell, or start mc(1) with -u
(--nosubshell) switch if you're confined to /bin/sh for some reason.
I remembered discussions and found Thread 81110 which is from the FreeBSD-11.4 times.This does not occur on earlier versions of FreeBSD.
When you create a user account you have the option to populate the user's home directory with so-called skeleton files. Those live in /usr/share/skel on FreeBSD. If you used pw(8) to create the user account:How does FreeBSD set up the default environment on a new installation? ie. is it through one of /.login, /.profile, /.shrc. I don't have any of these on my system.
-m This option instructs pw to attempt to create the user's
home directory. While primarily useful when adding a new
account with useradd, this may also be of use when moving
an existing user's home directory elsewhere on the file
system. The new home directory is populated with the
contents of the skeleton directory, which typically
contains a set of shell configuration files that the user
may personalize to taste. Files in this directory are
usually named dot.⟨config⟩ where the dot prefix will be
stripped. When -m is used on an account with usermod,
existing configuration files in the user's home directory
are not overwritten from the skeleton files.
When a user's home directory is created, it will by default
be a subdirectory of the basehome directory as specified by
the -b option, bearing the name of the new account. This
can be overridden by the -d option on the command line, if
desired.
I'm running as root. Are you saying the default shell for root has suddenly changed? That seems like a significant alteration.
Nothing 'sudden' about it.Are you saying the default shell for root has suddenly changed?
Significant enough to be mentioned in the release notes.That seems like a significant alteration.
The default shell for the root user is now sh(1), which has many new features for interactive use.
Oh yeah...those....Significant enough to be mentioned in the release notes.
Does this stop all this 'printf' nonesense?env SHELL=/usr/local/bin/bash mc
I don't know because I don't use mc.Does this stop all this 'printf' nonesense?
--- lib/shell.c.orig 2023-08-06 22:26:05 UTC
+++ lib/shell.c
@@ -99,22 +99,9 @@
static char *
mc_shell_get_name_env (void)
{
- const char *shell_env;
char *shell_name = NULL;
- shell_env = g_getenv ("SHELL");
- if ((shell_env == NULL) || (shell_env[0] == '\0'))
- {
- /* 2nd choice: user login shell */
- struct passwd *pwd;
-
- pwd = getpwuid (geteuid ());
- if (pwd != NULL)
- shell_name = g_strdup (pwd->pw_shell);
- }
- else
- /* 1st choice: SHELL environment variable */
- shell_name = g_strdup (shell_env);
+ shell_name = g_strdup ("/usr/local/bin/bash");
return shell_name;
}
mc(1)
Code:When the subshell support is active, Midnight Commander will spawn a concurrent copy of your shell (the one defined in the SHELL variable and if it is not defined, then the one in the /etc/passwd file)
env SHELL=/usr/local/bin/bash mc
history(1), for bash(1) that's usually ~/.bash_history. MC issues a bunch of commands, bash has an option to not record those commands in the history, csh doesn't have that feature. That's why csh's history is swamped with commands from MC while bash's history doesn't.Where would command history be recorded?