Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Terminal.app: Unable to set 'tab' & 'title' from command line (more in Description) #685

Open
2 tasks
seamusdemora opened this issue Sep 3, 2024 · 2 comments

Comments

@seamusdemora
Copy link

General information

macOS (16", 2023) w/ Ventura 13.6.9; using native Terminal.app
There are two (2) issues; perhaps related (?):

  1. Unable to set 'tab' or 'title' from zsh cmd line: echo -en "\033]0; New Name \007" yields nothing (no change)
  2. When 'tab' & 'title' are set using Inspector applet (p/o Terminal), the 'tab' & 'title' immediately revert to whatever they were previously as soon as a command is entered at the command line.

It has been suggested that pure may be the cause of this behavior. I don't know enough about pure to even have an opinion, but my first thought was, "Huh?!... what does my prompt have to do with tab & title?"

But whatever the cause, I must be able to set my tabs and title independently of the prompt. I have too many tabs open at all times to remember which tab I was using for a certain task.

System report (output of prompt_pure_system_report):

~/Library
==> prompt_pure_system_report
- Zsh: zsh 5.9 (x86_64-apple-darwin22.0) (/bin/zsh)
- Operating system: macOS 13.6.9 (22G830)
- Terminal program: Apple_Terminal (447.1)
- Tmux: no
- Git: git version 2.46.0
- Pure state:
    - username: `''`
    - prompt: `'==>'`
    - version: `1.23.0`
- zsh-async version: `1.8.6`
- PROMPT: `typeset -g PROMPT=$'%F{${prompt_pure_colors[path]}}%~%f
%}%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f '`
- Colors: `typeset -g -A prompt_pure_colors=( [execution_time]=yellow [git:action]=yellow [git:arrow]=cyan [git:branch]=242 [git:branch:cached]=red [git:dirty]=218 [git:stash]=cyan [host]=242 [path]=green [prompt:continuation]=199 [prompt:error]=199 [prompt:success]=199 [suspended_jobs]=red [user]=242 [user:root]=default [virtualenv]=242 )`
- TERM: `export TERM=xterm-256color`
- Virtualenv: `export VIRTUAL_ENV_DISABLE_PROMPT=12`
- Conda: `export CONDA_CHANGEPS1=no`
- Detected frameworks: None

Other information

I have:

  • Tested with another terminal program and can reproduce the issue:
  • Followed the integration instructions for my framework

Problem description

Please see ### General information

Reproduction steps

Please see ### General information

My .zshrc:

export HISTSIZE=50000
export SAVEHIST=10000000
setopt APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS

export PATH=/opt/local/libexec/gnubin:$PATH

# Add colors to Terminal
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

TMOUT=1
TRAPALRM() {
    zle reset-prompt
}

fpath+=($HOME/.zsh/pure)
autoload -U promptinit; promptinit
prompt pure
PURE_PROMPT_SYMBOL="==>"
zstyle :prompt:pure:path color green
#  zstyle :prompt:pure:prompt color white
zstyle ':prompt:pure:prompt:*' color 199
@mafredri
Copy link
Collaborator

mafredri commented Sep 3, 2024

Indeed, Pure is overriding the title you're trying to set. You could add this to your .zshrc after prompt pure to override the Pure behavior (override with a no-op function).

prompt_pure_set_title() {}

I'd be interested to know what you thought about the feature once you've been without it for a while. Did you miss it or was it just in the way?

Ideally we could check if the title has been modified by the user, but alas, that's not trivial. So ultimately I think it's a question of, is this good enough, can we make the behavior better, or do we need to introduce an option to disable it.

@seamusdemora
Copy link
Author

@mafredri

Mathias - thanks so much for that; esp the very prompt response!

WRT "what I think about the feature...": I'll be happy to provide some feedback after having disabled it for a while. But for me, I'm fairly certain I'll be much happier without it. My prompt is this:

/etc
==>

So I've got the most essential info there. In my use-case, the ability to set up fixed 'tab' names is important to me for the organizing aspect of it. I command-tab to get to the desktop w/ Terminal, and can immediately see which tab I need to jump into. I'm pretty dull I guess :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants