zsh: update prompt with current time when a command is started
Date : March 29 2020, 07:55 AM
I hope this helps you . I had a struggle to make this: It displays the date on the right side when the command has been executed. It does not overwrite the command shown. Warning: it may overwrite the current RPROMPT. strlen () {
FOO=$1
local zero='%([BSUbfksu]|([FB]|){*})'
LEN=${#${(S%%)FOO//$~zero/}}
echo $LEN
}
# show right prompt with date ONLY when command is executed
preexec () {
DATE=$( date +"[%H:%M:%S]" )
local len_right=$( strlen "$DATE" )
len_right=$(( $len_right+1 ))
local right_start=$(($COLUMNS - $len_right))
local len_cmd=$( strlen "$@" )
local len_prompt=$(strlen "$PROMPT" )
local len_left=$(($len_cmd+$len_prompt))
RDATE="\033[${right_start}C ${DATE}"
if [ $len_left -lt $right_start ]; then
# command does not overwrite right prompt
# ok to move up one line
echo -e "\033[1A${RDATE}"
else
echo -e "${RDATE}"
fi
}
|
run a command prompt command to start a solution in Visual Studio
Date : March 29 2020, 07:55 AM
this one helps. Right click on solution (in solution explorer view) -> properties -> Debug -> Command line arguments.
|
if prompt is empty, go back to start prompt command
Date : March 29 2020, 07:55 AM
I wish this helpful for you It seems that you need loop, loop does something while condition is true. var nick = prompt("Please enter your name", "");
while (nick == "" || nick == null) {
nick = prompt("Please enter your name", "");
}
$.connection.chathub.server.sendnick(nick);
|
cannot start windows service but can execute the command in command prompt
Date : March 29 2020, 07:55 AM
will help you It is very likely that you are trying to do the actual work in the OnStart() call instead of off-loading it to another thread. The OnStart() is used to initialize the service, but it has to return in order for the Service Manager to update the service state at a minimum. To do this correctly, the main loop of your service where the work is done should be put in a foreground thread that is started in the OnStart() callback, which allows the OnStart() call to return in a timely fashion. That should prevent the error you're seeing.
|
How I do invoke a PowerShell Start-Process command with arguments that require quoting from a Command Prompt / batch fil
Date : March 29 2020, 07:55 AM
help you fix your problem I am getting this error when trying exec one command in PowerShell: , Can someone please help me figure out why this is happening? powershell.exe -Command "Start-Process -Verb RunAs -FilePath attrib.exe -Args +h, +s, '\"%CD%\"'"
|