Ticket #4203 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

[patch] Support for custom init file for Zsh subshell

Reported by: psprint Owned by: andrew_b
Priority: major Milestone: 4.8.27
Component: mc-core Version: master
Keywords: zsh,subshell Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

A subshell Zshell, unlike Bash, will not read ~/.local/share/mc/bashrc – it doesn't have its own rc file support and it ignores bashrc. This patch changes this – ~/.local/share/mc/.zshrc file can be provided so that Zshell reads only it as the user RC file (besides the system rc in /etc).

The implementation sets ZDOTDIR in environment to ~/.local/share/mc if a .zshrc will be found there. It is the only way to point Zsh to an other RC file than the default.

Attachments

zshrc_for_subshell_zsh.patch (2.3 KB) - added by psprint 3 years ago.

Change History

Changed 3 years ago by psprint

comment:1 Changed 3 years ago by andrew_b

Patch review:

  • remove mc_log() calls
  • use mc_config_get_data_path() instead of g_path_get_dirname()
  • use g_setenv() instead of g_strconcat("ZDOTDIR=", init_file, (char *) NULL)
  • fix double free of init_file
  • add test for new config file in tests/lib/mcconfig/user_configs_path.c.

comment:2 Changed 3 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.27

comment:3 Changed 3 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Type changed from defect to enhancement
  • Branch state changed from on review to approved

comment:4 Changed 3 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:5 Changed 3 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.