jupyter / jupyter_console

Jupyter Terminal Console
http://jupyter-console.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
247 stars 146 forks source link

How to set terminal title as in IPython #291

Closed reckoner closed 1 year ago

reckoner commented 1 year ago

IPython has a term_title flag that can be used to allow IPython to set the terminal title. Is it possible for jupyter console to likewise set the terminal title? It does not do this by default.

reckoner commented 1 year ago

I just stuck this sys.stdout.write in app.py and it seems to work.

    def init_shell(self):
        JupyterConsoleApp.initialize(self)
        # relay sigint to kernel
        signal.signal(signal.SIGINT, self.handle_sigint)
        self.shell = ZMQTerminalInteractiveShell.instance(parent=self,
                        manager=self.kernel_manager,
                        client=self.kernel_client,
                        confirm_exit=self.confirm_exit,
        )
        self.shell.own_kernel = not self.existing
        sys.stdout.write('\033]0;%s\007' % 'Jupyter Console')