Skip to main content
added 94 characters in body
Source Link
atod
  • 155
  • 6

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm title bar.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow. I see the follow implementation for zsh, however I'm looking for ksh.

if [ "$SHELL" = '/usr/bin/zsh' ] then case $TERM in rxvt|*term) precmd() { print -Pn "\e]0;%m:%~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; esac fi 

I'm reading this post on using ksh's DEBUG trap or poster also comments that "running a background task that regularly inspects the output of ps -o stat= -o args= to see which processes run in foreground and what command they are executing" is preferred. Does anyone have more information on this?

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow. I see the follow implementation for zsh, however I'm looking for ksh.

if [ "$SHELL" = '/usr/bin/zsh' ] then case $TERM in rxvt|*term) precmd() { print -Pn "\e]0;%m:%~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; esac fi 

I'm reading this post on using ksh's DEBUG trap.

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm title bar.

I see Terminal.app on MacOS is determining the name of the invoked command somehow. I see the follow implementation for zsh, however I'm looking for ksh.

if [ "$SHELL" = '/usr/bin/zsh' ] then case $TERM in rxvt|*term) precmd() { print -Pn "\e]0;%m:%~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; esac fi 

I'm reading this post on using ksh's DEBUG trap or poster also comments that "running a background task that regularly inspects the output of ps -o stat= -o args= to see which processes run in foreground and what command they are executing" is preferred. Does anyone have more information on this?

show zsh implementation
Source Link
atod
  • 155
  • 6

zsh or ksh: how to capture the current invoked command and arguments?

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow. I see the follow implementation for zsh, however I'm looking for ksh.

if [ "$SHELL" = '/usr/bin/zsh' ] then case $TERM in rxvt|*term) precmd() { print -Pn "\e]0;%m:%~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; esac fi 

I'm reading this post on using ksh's DEBUG trap.

zsh or ksh: how to capture the current invoked command and arguments?

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow.

ksh: how to capture the current invoked command and arguments?

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow. I see the follow implementation for zsh, however I'm looking for ksh.

if [ "$SHELL" = '/usr/bin/zsh' ] then case $TERM in rxvt|*term) precmd() { print -Pn "\e]0;%m:%~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; esac fi 

I'm reading this post on using ksh's DEBUG trap.

explain that macOS is doing it
Source Link
atod
  • 155
  • 6

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow.

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm.

For ksh93 I was using:

alias command='command ' command 'cd' "$@" && setprompt && settitle 

I think I need something similar but for all commands?

I see Terminal.app on MacOS is determining the name of the invoked command somehow.

Post Undeleted by atod
Post Deleted by atod
Source Link
atod
  • 155
  • 6
Loading