csh -> tcsh
ci / ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled
release / ${{ matrix.target }} (macos-latest, aarch64-apple-darwin) (push) Has been cancelled
release / ${{ matrix.target }} (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
release / ${{ matrix.target }} (true, ubuntu-latest, aarch64-unknown-linux-musl) (push) Has been cancelled
release / ${{ matrix.target }} (true, ubuntu-latest, armv7-unknown-linux-musleabihf) (push) Has been cancelled
release / ${{ matrix.target }} (true, ubuntu-latest, i686-unknown-linux-musl) (push) Has been cancelled
release / ${{ matrix.target }} (true, ubuntu-latest, x86_64-unknown-linux-musl) (push) Has been cancelled
release / ${{ matrix.target }} (ubuntu-latest, aarch64-linux-android) (push) Has been cancelled
release / ${{ matrix.target }} (ubuntu-latest, arm-unknown-linux-musleabihf) (push) Has been cancelled
release / ${{ matrix.target }} (windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
release / ${{ matrix.target }} (windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled

This commit is contained in:
Ajeet D'Souza
2025-05-06 00:26:07 -07:00
parent 09aa626a86
commit 095b270fea
10 changed files with 45 additions and 26 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Support for Csh.
- Support for Tcsh.
- Added `--score` flag to `zoxide add`.
### Changed
+12
View File
@@ -280,6 +280,18 @@ zoxide can be installed in 4 easy steps:
</details>
<details>
<summary>Tcsh</summary>
> Add this to the <ins>**end**</ins> of your config file (usually `~/.tcshrc`):
>
> ```sh
> zoxide init tcsh > ~/.zoxide.tcsh
> source ~/.zoxide.tcsh
> ```
</details>
<details>
<summary>Xonsh</summary>
+1 -1
View File
@@ -114,7 +114,7 @@ _arguments "${_arguments_options[@]}" : \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':shell:(bash csh elvish fish nushell posix powershell xonsh zsh)' \
':shell:(bash elvish fish nushell posix powershell tcsh xonsh zsh)' \
&& ret=0
;;
(query)
+1 -1
View File
@@ -173,7 +173,7 @@ _zoxide() {
return 0
;;
zoxide__init)
opts="-h -V --no-cmd --cmd --hook --help --version bash csh elvish fish nushell posix powershell xonsh zsh"
opts="-h -V --no-cmd --cmd --hook --help --version bash elvish fish nushell posix powershell tcsh xonsh zsh"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
+1 -1
View File
@@ -189,12 +189,12 @@ const completion: Fig.Spec = {
name: "shell",
suggestions: [
"bash",
"csh",
"elvish",
"fish",
"nushell",
"posix",
"powershell",
"tcsh",
"xonsh",
"zsh",
],
+8
View File
@@ -55,6 +55,14 @@ $profile\fR in PowerShell):
\fBInvoke-Expression (& { (zoxide init powershell | Out-String) })\fR
.fi
.TP
.B tcsh
Add this to the \fBend\fR of your config file (usually \fB~/.tcshrc\fR):
.sp
.nf
\fBzoxide init tcsh > ~/.zoxide.tcsh\fR
\fBsource ~/.zoxide.tcsh\fR
.fi
.TP
.B xonsh
Add this to the \fBend\fR of your config file (usually \fB~/.xonshrc\fR):
.sp
+1 -2
View File
@@ -147,14 +147,13 @@ pub enum InitHook {
#[derive(ValueEnum, Clone, Debug)]
pub enum InitShell {
Bash,
#[clap(alias = "tcsh")]
Csh,
Elvish,
Fish,
Nushell,
#[clap(alias = "ksh")]
Posix,
Powershell,
Tcsh,
Xonsh,
Zsh,
}
+2 -2
View File
@@ -6,7 +6,7 @@ use rinja::Template;
use crate::cmd::{Init, InitShell, Run};
use crate::config;
use crate::error::BrokenPipeHandler;
use crate::shell::{Bash, Csh, Elvish, Fish, Nushell, Opts, Posix, Powershell, Xonsh, Zsh};
use crate::shell::{Bash, Elvish, Fish, Nushell, Opts, Posix, Powershell, Tcsh, Xonsh, Zsh};
impl Run for Init {
fn run(&self) -> Result<()> {
@@ -17,12 +17,12 @@ impl Run for Init {
let source = match self.shell {
InitShell::Bash => Bash(opts).render(),
InitShell::Csh => Csh(opts).render(),
InitShell::Elvish => Elvish(opts).render(),
InitShell::Fish => Fish(opts).render(),
InitShell::Nushell => Nushell(opts).render(),
InitShell::Posix => Posix(opts).render(),
InitShell::Powershell => Powershell(opts).render(),
InitShell::Tcsh => Tcsh(opts).render(),
InitShell::Xonsh => Xonsh(opts).render(),
InitShell::Zsh => Zsh(opts).render(),
}
+15 -15
View File
@@ -24,12 +24,12 @@ macro_rules! make_template {
}
make_template!(Bash, "bash.txt");
make_template!(Csh, "csh.txt");
make_template!(Elvish, "elvish.txt");
make_template!(Fish, "fish.txt");
make_template!(Nushell, "nushell.txt");
make_template!(Posix, "posix.txt");
make_template!(Powershell, "powershell.txt");
make_template!(Tcsh, "tcsh.txt");
make_template!(Xonsh, "xonsh.txt");
make_template!(Zsh, "zsh.txt");
@@ -94,20 +94,6 @@ mod tests {
.stderr("");
}
#[apply(opts)]
fn csh_tcsh(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
let source = Csh(&opts).render().unwrap();
Command::new("tcsh")
.args(["-e", "-f", "-s"])
.write_stdin(source)
.assert()
.success()
.stdout("")
.stderr("");
}
#[apply(opts)]
fn elvish_elvish(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
@@ -263,6 +249,20 @@ mod tests {
.stderr("");
}
#[apply(opts)]
fn tcsh_tcsh(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
let source = Tcsh(&opts).render().unwrap();
Command::new("tcsh")
.args(["-e", "-f", "-s"])
.write_stdin(source)
.assert()
.success()
.stdout("")
.stderr("");
}
#[apply(opts)]
fn xonsh_black(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
+3 -3
View File
@@ -68,7 +68,7 @@ alias {{cmd}}i __zoxide_zi
{%- endmatch %}
{{ section }}
# To initialize zoxide, add this to your shell configuration file (usually ~/.cshrc or ~/.tcshrc):
# To initialize zoxide, add this to your shell configuration file (usually ~/.tcshrc):
#
# zoxide init csh > ~/.zoxide.csh
# source ~/.zoxide.csh
# zoxide init tcsh > ~/.zoxide.tcsh
# source ~/.zoxide.tcsh