Skip to content

Commit ad073ff

Browse files
committed
feat: .ctx now show's the name of the current context, if one is set
1 parent 03ffeb3 commit ad073ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xs.nu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ export def .remove [id: string] {
159159
export alias .rm = .remove
160160

161161
export def ".ctx" [] {
162-
xs-context | or-else { $XS_CONTEXT_SYSTEM }
162+
let id = xs-context | or-else { $XS_CONTEXT_SYSTEM }
163+
let name = xs-context-collect | where id == $id | get name.0
164+
$name | default $id
163165
}
164166

165167
export def ".ctx list" [] {

0 commit comments

Comments
 (0)