1

I have a program called xatelite, that is literally a script in /usr/local/bin/xatelite that has the following content.

#!/usr/bin/python3.6

# -*- coding: utf-8 -*-
import re
import sys

from xatelite import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

When I run this within a tmux instance, the pane takes the name python3.6*, because that is the process that is running. How do I make sure that the process is named xatelite. I want this to also be the case in htop and other programs that inspect processes.

Enrico Borba
  • 1,877
  • 2
  • 14
  • 26
  • The process is probably named `python3.6 xatelite` and `tmux` is only displaying the first word. Can you check in `ps aux | grep '[x]atelite'`? – Arkadiusz Drabczyk Aug 04 '19 at 17:58
  • You are correct, the process is named `/usr/bin/python3.6 /usr/local/bin/xatelite`. Is that because the shebang causes it to be executed it like that? – Enrico Borba Aug 04 '19 at 18:13
  • I think so, see here https://stackoverflow.com/questions/2255444/changing-the-process-name-of-a-python-script for possible solutions. – Arkadiusz Drabczyk Aug 04 '19 at 18:27

1 Answers1

0

You can start a new session with

tmux new -n windowname program

Within the tmux session you can change the name of the window with PREFIX + ,

UtLox
  • 3,744
  • 2
  • 10
  • 13