[Cialug] Bash 4.1 question

Todd Walton tdwalton at gmail.com
Thu Sep 8 17:19:52 CDT 2011


On Thu, Sep 8, 2011 at 3:42 PM, Daniel A. Ramaley
<daniel.ramaley at drake.edu> wrote:
> On one of my machines, when i type ctrl-c bash prints "^C" and then
> starts a fresh command prompt on the next line. On other machines
> (including SSH sessions), it doesn't print the "^C"... it just starts a
> new prompt on the next line.

Line 2532 of the jobs.c source says:

/* If job control is enabled, the job was started with job
control, the job was the foreground job, and it was killed
by SIGINT, then print a newline to compensate for the kernel
printing the ^C without a trailing newline. */
if (job_control && IS_JOBCONTROL (job) && IS_FOREGROUND (job) &&
WIFSIGNALED (s) && WTERMSIG (s) == SIGINT)

Perhaps it's the kernel that prints it.

--
Todd


More information about the Cialug mailing list