randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.37k stars 83 forks source link

[Question] Set tab title to ${file_name} #373

Open Mark-Joy opened 1 year ago

Mark-Joy commented 1 year ago

I am completly new to sublimeText and Terminus, so please excuse me if I ask something so obvious. How can I set tab title to ${file_name}? The below code does not work.

[
    {
        "caption": "Terminus: Open iPython",
        "command": "terminus_open",
        "args"   : {
            "cmd": "ipython",
            "cwd": "${file_path:${folder}}",
            "title": "${file_name}"
        }
    }
]
randy3k commented 1 year ago

We currently do not "expand_variables" for the title argument. See for example how it could be done: https://github.com/randy3k/Terminus/blob/0295b96130a52d602dd890472e446af67192f7bb/terminus/commands.py#L155-L155

A PR is welcome.