You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
956 B

  1. --- a/src/subshell/common.c
  2. +++ b/src/subshell/common.c
  3. @@ -843,16 +843,9 @@ init_subshell_precmd (char *precmd, size
  4. * "PS1='$($PRECMD)$ '\n",
  5. */
  6. g_snprintf (precmd, buff_size,
  7. - "precmd() { "
  8. - "if [ ! \"${PWD##$HOME}\" ]; then "
  9. - "MC_PWD=\"~\"; "
  10. - "else "
  11. - "[ \"${PWD##$HOME/}\" = \"$PWD\" ] && MC_PWD=\"$PWD\" || MC_PWD=\"~/${PWD##$HOME/}\"; "
  12. - "fi; "
  13. - "echo \"$USER@$(hostname -s):$MC_PWD\"; "
  14. - "pwd>&%d; "
  15. - "kill -STOP $$; "
  16. - "}; " "PRECMD=precmd; " "PS1='$($PRECMD)$ '\n", subshell_pipe[WRITE]);
  17. + "precmd() { pwd>&%d; kill -STOP $$; }; "
  18. + "PRECMD=precmd; "
  19. + "PS1='$(eval $PRECMD)\\u@\\h:\\w\\$ '\n", subshell_pipe[WRITE]);
  20. break;
  21. case SHELL_ZSH: