helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
32.58k stars 2.4k forks source link

Set shell title when opening/changing directory/file #2887

Closed jakenvac closed 2 years ago

jakenvac commented 2 years ago

I think it would be really beneficial to set the bash title to the working directory/file in question where possible.

This will allow users to lean on terminal multiplexers such as wezterm, tmux etc. for their window and tab management and be able to quickly switch between files etc.

I've created a tiny command that sets the title and then launches hx to achieve this functionality but it's pretty wonky and doesn't work 100% of the time.

Here's a screenshot of what it looks like, next to a terminal where I have a bunch of hx instances where I've not set the title.

I think it's immediately clear how beneficial this is: image Note: Image is using yabai window manager and wezterm as a multiplexer

If anyone wants to try and make a better launch script, here's just the title part

function title {
  echo -en "\033]0;$@\a"
}

Update: I've just had another thought, this could be something that gets left for when/if hooks are implemented. If that's the case, feel free to close this issue.

jakenvac commented 2 years ago

To follow up, I think the more hx can rely on the environment and shell to pick up some of the heavy lifting until the team has time to get round to integrating (where they see fit), the better.

Personally I really like kakoune's attitude towards that being the first class way of extending the editor. The problem is the implementation.

the-mikedavis commented 2 years ago

Duplicate of https://github.com/helix-editor/helix/issues/2436

jakenvac commented 2 years ago

Thanks, I've made a few dupes now, sorry! Not sure why my searches aren't bringing these issues up.... I'll share my thoughts over there. Thanks!