Skip to content

setting title when PROMPT_COMMAND is set #9

@bemurphy

Description

@bemurphy

I might be dense on this, but I have PROMPT_COMMAND set in my ~/.bashrc for setting terminal title to the current directory.

The problem is, the prompt command runs after consular has set the title, so it overrides what consular has set. So, I put this in my project Termfile:

def set_title(context)
  run "unset PROMPT_COMMAND"
  run 'echo -e "\033];' + context[:options][:name] + '\007"'
  run "clear"
end

tab("server") do
  set_title(_context)
  run "bsa"
end

This works, but I'm looking for a hook to a better solution. If one doesn't exist and I find it I'll put in a PR. Know of anything though?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions