Closed zhuzhzh closed 4 years ago
If I remember correctly, cshell doesn't get a $PROMPT_COMMAND
or can't evaluate script in the $PS1
, z.lua or autojump require to be executed everytime you press enter (display the prompt).
If you can figure out a way for it, cshell is possible to run z.lua.
check the below website: https://tldp.org/HOWTO/Xterm-Title-4.html
tcsh has some functions and expansions similar to those of zsh:
precmd () a function which is executed just before each prompt
cwdcmd () a function which is executed whenever the directory is changed
%n expands to username
%m expands to hostname
%~ expands to directory, replacing $HOME with '~'
%# expands to '>' for normal users, '#' for root users
%{...%} includes a string as a literal escape sequence
fantastic ! can you create a PR for this ?
porting z.lua to csh requires a _zlua()
function (which can be found here ). and a shell hook.
I am not skilled in csh scripting.
It can be implemented in a separated csh script file which will setup the _zlua()
function and the hook by invoking z.lua
I tried to write the wrapper for tcsh. but tcsh doesn't have funciton supporting. ans alias has many limitation (like doesn't support newline). after some effort, it still doens't work as expected. so I decided to give up. Thanks all the time! I actually know how to make it work.
There is a tool, bass, can allow fish shell users call bash script. It can record working dir and environment variable changes in the bash script, and apply them in fish shell.
And another _zlua.tcsh
script to simulate _zlua
function ?
Is it possible to do similar things in tcsh ??
yes, because tcsh doesn't support function, need use script file to simulate the function call. I think it would break current style (all in one), so didn't do this.
I know cshell is not used widely. unfornately, hw engineer has to use it, because it's recommended by all eda tools. I want to check if it's possable to support cshell with a little effort. if it needs lots of effort, just ignore this question