Choose style:

Author Topic: Terminal: Title show current foreground process(make terminal more informative)  (Read 228 times)

0 Members and 1 Guest are viewing this topic.

Offline neomorph

  • nOOb
  • *
  • Posts: 4
  • Karma: -2
  • New Forum User
    • View Profile
  • Peppermint version(s): 9
Taken from here: https://ip.engineering/gnome-terminal-running-processcommand-name-tab-title/

Copy paste it and end of .bashrc and modify to your taste.

I changed to this:

Code: [Select]
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

    # Show the currently running command in the terminal title:
    # http://www.davidpashley.com/articles/xterm-titles-with-bash.html
    show_command_in_title_bar()
    {
        case "$BASH_COMMAND" in
            *\033]0*)
            # The command is trying to set the title bar as well;
            # this is most likely the execution of $PROMPT_COMMAND.
            # In any case nested escapes confuse the terminal, so don't
            # output them.
                ;;
            *)
             echo -ne "\033]0;${BASH_COMMAND}\007"
                ;;
        esac
    }
    trap show_command_in_title_bar DEBUG
    ;;
*)
    ;;
esac

This should be made peppermint default. Where should i contribute this?
« Last Edit: December 17, 2018, 12:18:45 pm by neomorph »