mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
tcsh support
Adds basic supported for tcsh in response to https://github.com/banga/powerline-shell/issues/299
This commit is contained in:
parent
365a6d9a02
commit
51e5dd14c2
10
README.md
10
README.md
|
|
@ -1,7 +1,7 @@
|
|||
# A Powerline style prompt for your shell
|
||||
|
||||
A [Powerline](https://github.com/Lokaltog/vim-powerline) like prompt for Bash,
|
||||
ZSH and Fish:
|
||||
ZSH, Fish, and tcsh:
|
||||
|
||||

|
||||
|
||||
|
|
@ -132,6 +132,14 @@ function fish_prompt
|
|||
end
|
||||
```
|
||||
|
||||
### tcsh
|
||||
|
||||
Add the following to your `.tcshrc`:
|
||||
|
||||
```
|
||||
alias precmd 'set prompt="`powerline-shell --shell tcsh $?`"'
|
||||
```
|
||||
|
||||
## Customization
|
||||
|
||||
### Config File
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ class Powerline(object):
|
|||
}
|
||||
|
||||
color_templates = {
|
||||
'bash': '\\[\\e%s\\]',
|
||||
'bash': r'\[\e%s\]',
|
||||
'tcsh': r'%%{\e%s%%}',
|
||||
'zsh': '%%{%s%%}',
|
||||
'bare': '%s',
|
||||
}
|
||||
|
|
@ -159,7 +160,7 @@ def main():
|
|||
help='Generate the default config and print it to stdout')
|
||||
arg_parser.add_argument('--shell', action='store', default='bash',
|
||||
help='Set this to your shell type',
|
||||
choices=['bash', 'zsh', 'bare'])
|
||||
choices=['bash', 'tcsh', 'zsh', 'bare'])
|
||||
arg_parser.add_argument('prev_error', nargs='?', type=int, default=0,
|
||||
help='Error code returned by the last command')
|
||||
args = arg_parser.parse_args()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
from ..utils import BasicSegment
|
||||
from ..utils import BasicSegment, warn
|
||||
|
||||
|
||||
class Segment(BasicSegment):
|
||||
def add_to_powerline(self):
|
||||
if self.powerline.args.shell == "tcsh":
|
||||
warn("newline segment not supported for tcsh (yet?)")
|
||||
return
|
||||
self.powerline.append("\n",
|
||||
self.powerline.theme.RESET,
|
||||
self.powerline.theme.RESET,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class Segment(BasicSegment):
|
|||
powerline = self.powerline
|
||||
root_indicators = {
|
||||
'bash': ' \\$ ',
|
||||
'tcsh': ' %# ',
|
||||
'zsh': ' %# ',
|
||||
'bare': ' $ ',
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue