b-ryan / powerline-shell

A beautiful and useful prompt for your shell
MIT License
6.22k stars 746 forks source link

tcsh - new line #450

Open rjl6789 opened 5 years ago

rjl6789 commented 5 years ago

Hi,

Thanks for this - a great powerline like shell implementation, especially given the support for tcsh, which I'm currently forced into at work. (the standard powerline not working with tcsh as far as I know )

Anyway - I noted that there was no newline support for tcsh. Please see below my attempt at getting it to work. It seems to now (at least for me!). Note the space before \\n and also the double \\ I've no idea why this works but after playing around for a bit it does appear to. Any education on why this is the case would be great. Anyway, hope this is useful. Rob

# powerline_shell/segments/newline.py
from ..utils import BasicSegment, warn

class Segment(BasicSegment):
    def add_to_powerline(self):
        if self.powerline.args.shell == "tcsh":
             self.powerline.append(" \\n",
                                   self.powerline.theme.RESET,
                                   self.powerline.theme.RESET,
                                   separator="")
        else:
             self.powerline.append("\n",
                                   self.powerline.theme.RESET,
                                   self.powerline.theme.RESET,
                                   separator="")
rmarinbe commented 4 years ago

thank you so much it worked perfect for me, it is weird that nobody else has responded...