Skip to content

Instantly share code, notes, and snippets.

@bemurphy
Created March 31, 2013 22:04
Show Gist options
  • Save bemurphy/fe988660cf85431ad86a to your computer and use it in GitHub Desktop.
Save bemurphy/fe988660cf85431ad86a to your computer and use it in GitHub Desktop.
module ConsularTitleHack
def self.setup(namespace)
namespace.instance_eval do
alias :run_orig :run
end
def namespace.run(*commands)
if _context.is_a?(Hash) && ! _context[:_title_hacked]
_context[:_title_hacked] = true
run_orig('unset PROMPT_COMMAND')
run_orig('echo -e "\033];' + _context[:options][:name] + '\007"')
end
run_orig(*commands)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment