Skip to content

Instantly share code, notes, and snippets.

@rjminsha
Created September 22, 2014 14:49
Show Gist options
  • Select an option

  • Save rjminsha/d3bc496f01f6221ec0a1 to your computer and use it in GitHub Desktop.

Select an option

Save rjminsha/d3bc496f01f6221ec0a1 to your computer and use it in GitHub Desktop.
Sets the name of the terminal in MacOS.
#!/bin/bash
#********************************************************************************
# Copyright 2014 IBM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
#********************************************************************************
# Sets name of the maxOS terminal
usage()
{
echo "Usage: `basename $0` nameOfWindow"
echo ""
echo "Sets the name of the terminal window on your mac"
echo ""
}
if [ "$#" == "1" ]; then
echo "setting name of tab to $1"
echo -n -e "\033]0;$1\007"
else
echo "incorrect arguments"
usage
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment