[clug] Programmable title

Eyal Lebedinsky eyal at eyal.emu.id.au
Fri Oct 17 06:54:08 MDT 2014


Bryan,

Are you sure it says
	echo (tty) | cut -c 10-
and not
	echo $(tty) | cut -c 10-
or simply, as done earlier
	tty | cut -c 10-

But regardless, it will not parse a /dev/tty* correctly.

Maybe separate the two cases, like

	case "`tty | cut -c 6-8`" in
	pts)
		...message for a pts...
		;;
	tty)
		...message for a terminal...
		;;
	*)
		echo "on `tty`"
		;;
	esac

Good Night,
	Eyal

On 17/10/14 23:24, Bryan Kilgallin wrote:
> I have the following in the config.fish file.
>
> function fish_title
>      echo $_ 'shell '
>      tty | cut -c 6-8
>      echo ' on line '
>      echo (tty) | cut -c 10-
> end
>
> So the terminal window title reads as follows.
>
> "fish shell pts on line 0"
>
> I would like that to substitute instead of "pts" rather "pseudo terminal".
> In the case of being a "tty", then I'd like the title to say "terminal" instead.

-- 
Eyal Lebedinsky (eyal at eyal.emu.id.au)


More information about the linux mailing list