bat icon indicating copy to clipboard operation
bat copied to clipboard

Set file name as terminal title

Open Talinx opened this issue 1 year ago • 1 comments

Currently bat does not change the terminal title. Showing the file name in the terminal can be useful for navigating between terminal tabs.

For example, the following script sets the terminal title to the file name before displaying it with bat:

#!/bin/bash
echo -ne "\033]0;$1\007"
bat $1

The actual implementation inside bat should be more sophisticated by setting the title appropriately when viewing multiple files, resetting the title on exit etc.

Talinx avatar Nov 24 '23 17:11 Talinx

I'd like this feature as well, I'm going to look at adding it over the next few days!

Oliver-Looney avatar Dec 10 '23 16:12 Oliver-Looney