Skip to content

Commit

Permalink
feat: add/improve CC prompt display support
Browse files Browse the repository at this point in the history
  • Loading branch information
mike325 committed Aug 27, 2024
1 parent 4e255e9 commit 194470d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 65 deletions.
4 changes: 2 additions & 2 deletions shell/settings/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ else
# }

function __cc_view() {
if [[ -n $CLEARCASE_CMDLINE ]]; then
echo -e "${echo_red}($(echo "$CLEARCASE_CMDLINE" | awk "{ \$2 = substr(\$2,${#USER}+5) } {print \$2}"))${echo_reset_color}"
if [[ -n $CLEARCASE_ROOT ]]; then
echo -e "${echo_red}($(echo "$CLEARCASE_ROOT" | awk -F/ -v pat="${USER}_at_" '{gsub(pat, "", $3 ) ; print $3}'))${echo_reset_color}"
fi
}

Expand Down
43 changes: 13 additions & 30 deletions shell/settings/csh.csh
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
#!/usr/bin/env tcsh

################################################################################
# #
# NOT TESTED!!!! Draft of a simple/basic port of my shellrc #
# #
# Author: Mike 8a #
# Description: Small shell configs #
# #
# -` #
# ... .o+` #
# .+++s+ .h`. `ooo/ #
# `+++%++ .h+++ `+oooo: #
# +++o+++ .hhs++. `+oooooo: #
# +s%%so%.hohhoo' 'oooooo+: #
# `+ooohs+h+sh++`/: ++oooo+: #
# hh+o+hoso+h+`/++++.+++++++: #
# `+h+++h.+ `/++++++++++++++: #
# `/+++ooooooooooooo/` #
# ./ooosssso++osssssso+` #
# .oossssso-````/osssss::` #
# -osssssso. :ssss``to. #
# :osssssss/ Mike osssl + #
# /ossssssss/ 8a +sssslb #
# `/ossssso+/:- -:/+ossss'.- #
# `+sso+:-` `.-/+oso: #
# `++:. `-/+/ #
# .` github.com/mike325/dotfiles `/ #
# #
################################################################################

# Magic tcsh stuff
set autolist
set prompt="%B`whoami`%b@`hostname -s` at %B[$CWD:t]%b -> "
if ($?CLEARCASE_ROOT) then
setenv CC_VIEW_NAME `echo "$CLEARCASE_ROOT" | awk -F/ -v pat="${USER}_at_" '{gsub(pat, "", $3 ) ; print $3}'`
set prompt="\n%B`[ $USER = root ] && echo $USER@`%b%m: %B[%~]%b - CC: %B$CC_VIEW_NAME%b\n> "
else
set prompt="\n%B`[ $USER = root ] && echo $USER@`%b%m: %B[%~]%b\n> "
endif

if ( -d "$HOME/.fzf/bin/" ) then
setenv PATH "$HOME/.fzf/bin/:${PATH}"
endif
if ( `where tmux` != "" ) then
bindkey -c ^a "tmux a || tmux new -s main"
endif
37 changes: 6 additions & 31 deletions shell/settings/tcsh.csh
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
#!/usr/bin/env tcsh

################################################################################
# #
# NOT TESTED!!!! Draft of a simple/basic port of my shellrc #
# #
# Author: Mike 8a #
# Description: Small shell configs #
# #
# -` #
# ... .o+` #
# .+++s+ .h`. `ooo/ #
# `+++%++ .h+++ `+oooo: #
# +++o+++ .hhs++. `+oooooo: #
# +s%%so%.hohhoo' 'oooooo+: #
# `+ooohs+h+sh++`/: ++oooo+: #
# hh+o+hoso+h+`/++++.+++++++: #
# `+h+++h.+ `/++++++++++++++: #
# `/+++ooooooooooooo/` #
# ./ooosssso++osssssso+` #
# .oossssso-````/osssss::` #
# -osssssso. :ssss``to. #
# :osssssss/ Mike osssl + #
# /ossssssss/ 8a +sssslb #
# `/ossssso+/:- -:/+ossss'.- #
# `+sso+:-` `.-/+oso: #
# `++:. `-/+/ #
# .` github.com/mike325/dotfiles `/ #
# #
################################################################################

# Magic tcsh stuff
set autolist
set prompt="%B %n%b@%m at %B[%~]%b -> "
if ($?CLEARCASE_ROOT) then
setenv CC_VIEW_NAME `echo "$CLEARCASE_ROOT" | awk -F/ -v pat="${USER}_at_" '{gsub(pat, "", $3 ) ; print $3}'`
set prompt="\n%B`[ $USER = root ] && echo $USER@`%b%m: %B[%~]%b - CC: %B$CC_VIEW_NAME%b\n> "
else
set prompt="\n%B`[ $USER = root ] && echo $USER@`%b%m: %B[%~]%b\n> "
endif

if ( -d "$HOME/.fzf/bin/" ) then
setenv PATH "$HOME/.fzf/bin/:${PATH}"
endif

if ( `where tmux` != "" ) then
bindkey -c ^a "tmux a || tmux new -s main"
endif
4 changes: 2 additions & 2 deletions shell/zfunctions/_cc_view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if [[ -n $CLEARCASE_CMDLINE ]]; then
echo "%F{red}($(echo "$CLEARCASE_CMDLINE" | awk "{ \$2 = substr(\$2,${#USER}+5) } {print \$2}"))%f"
if [[ -n $CLEARCASE_ROOT ]]; then
echo "%F{red}($(echo "$CLEARCASE_ROOT" | awk -F/ -v pat="${USER}_at_" '{gsub(pat, "", $3 ) ; print $3}'))%f"
fi

0 comments on commit 194470d

Please sign in to comment.