Bash-4.0 Official Patch 11

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-011

Bug-Reported-by:Matt Zyzik n
Bug-Reference-ID:   <20090312015018.c0074138...@ice.filescope.com>
Bug-Reference-URL:  
http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00092.html

Bug-Description:

When using the new |& operator following a simple command with a redirection,
the redirection of stderr through the pipe was not performed under certain
circumstances.

Patch:

*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.0 -0400
--- parse.y 2009-03-12 21:36:23.0 -0400
***
*** 1123,1127 
  REDIRECT *r;
  
! tc = $1;
  rd.dest = 1;
  r = make_redirection (2, r_duplicating_output, rd);
--- 1123,1127 
  REDIRECT *r;
  
! tc = $1->type == cm_simple ? (COMMAND 
*)$1->value.Simple : $1;
  rd.dest = 1;
  r = make_redirection (2, r_duplicating_output, rd);
*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 10
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 11
  
  #endif /* _PATCHLEVEL_H_ */


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Bash-4.0 Official Patch 12

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-012

Bug-Reported-by:"Clark J. Wang" 
Bug-Reference-ID:   

Bug-Reference-URL:  
http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00129.html

Bug-Description:

A case statement using the ;& pattern terminator followed immediately by
"esac" caused a core dump due to a null pointer dereference.

Patch:

*** ../bash-4.0-patched/execute_cmd.c   2009-02-13 16:41:41.0 -0500
--- execute_cmd.c   2009-03-14 13:23:00.0 -0400
***
*** 2931,2935 
}
  while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = 
clauses->next));
! if ((clauses->flags & CASEPAT_TESTNEXT) == 0)
EXIT_CASE ();
  else
--- 2931,2935 
}
  while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = 
clauses->next));
! if (clauses == 0 || (clauses->flags & CASEPAT_TESTNEXT) == 0)
EXIT_CASE ();
  else
*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 11
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 12
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Bash-4.0 Official Patch 15

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-015

Bug-Reported-by:Lubomir Rintel 
Bug-Reference-ID:   <1237654931.32737.13.ca...@localhost.localdomain>
Bug-Reference-URL:  
http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00174.html

Bug-Description:

Deferring handling of signals which should cause the shell to terminate until
it is "safe" to run the handler functions does not work for some terminating
signals.

Patch:

*** ../bash-4.0-patched/sig.c   2009-01-04 14:32:41.0 -0500
--- sig.c   2009-03-22 14:47:56.0 -0400
***
*** 449,452 
--- 449,494 
   int sig;
  {
+   /* If we get called twice with the same signal before handling it,
+  terminate right away. */
+   if (
+ #ifdef SIGHUP
+ sig != SIGHUP &&
+ #endif
+ #ifdef SIGINT
+ sig != SIGINT &&
+ #endif
+ #ifdef SIGDANGER
+ sig != SIGDANGER &&
+ #endif
+ #ifdef SIGPIPE
+ sig != SIGPIPE &&
+ #endif
+ #ifdef SIGALRM
+ sig != SIGALRM &&
+ #endif
+ #ifdef SIGTERM
+ sig != SIGTERM &&
+ #endif
+ #ifdef SIGXCPU
+ sig != SIGXCPU &&
+ #endif
+ #ifdef SIGXFSZ
+ sig != SIGXFSZ &&
+ #endif
+ #ifdef SIGVTALRM
+ sig != SIGVTALRM &&
+ #endif
+ #ifdef SIGLOST
+ sig != SIGLOST &&
+ #endif
+ #ifdef SIGUSR1
+ sig != SIGUSR1 &&
+ #endif
+ #ifdef SIGUSR2
+sig != SIGUSR2 &&
+ #endif
+sig == terminating_signal)
+ terminate_immediately = 1;
+ 
terminating_signal = sig;
  
*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 14
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 15
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Bash-4.0 Official Patch 14

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-014

Bug-Reported-by:small...@gmail.com
Bug-Reference-ID:   <49c460fe.40...@gmail.com>
Bug-Reference-URL:  
http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00166.html

Bug-Description:

When the fc builtin is run in a command substitution from a shell with history
enabled, it does not correctly calculate the command on which to operate.

Patch:

*** ../bash-4.0-patched/builtins/fc.def 2009-01-04 14:32:22.0 -0500
--- builtins/fc.def 2009-03-21 14:03:43.0 -0400
***
*** 89,92 
--- 89,93 
  extern int literal_history;
  extern int posixly_correct;
+ extern int subshell_environment, interactive_shell;
  
  extern int unlink __P((const char *));
***
*** 173,177 
register char *sep;
int numbering, reverse, listing, execute;
!   int histbeg, histend, last_hist, retval, opt;
FILE *stream;
REPL *rlist, *rl;
--- 174,178 
register char *sep;
int numbering, reverse, listing, execute;
!   int histbeg, histend, last_hist, retval, opt, rh;
FILE *stream;
REPL *rlist, *rl;
***
*** 276,279 
--- 277,282 
fprintf (stderr, "%s\n", command);
fc_replhist (command);  /* replace `fc -s' with command */
+   /* Posix says that the re-executed commands should be entered into the
+history. */
return (parse_and_execute (command, "fc", SEVAL_NOHIST));
  }
***
*** 294,298 
   so we check hist_last_line_added. */
  
!   last_hist = i - remember_on_history - hist_last_line_added;
  
if (list)
--- 297,306 
   so we check hist_last_line_added. */
  
!   /* Even though command substitution through parse_and_execute turns off
!  remember_on_history, command substitution in a shell when set -o history
!  has been enabled (interactive or not) should use it in the last_hist
!  calculation as if it were on. */
!   rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && 
enable_history_list);
!   last_hist = i - rh - hist_last_line_added;
  
if (list)
***
*** 457,461 
   HIST_ENTRY **hlist;
  {
!   int sign, n, clen;
register int i, j;
register char *s;
--- 465,469 
   HIST_ENTRY **hlist;
  {
!   int sign, n, clen, rh;
register int i, j;
register char *s;
***
*** 473,477 
   so we check hist_last_line_added.  This needs to agree with the
   calculation of last_hist in fc_builtin above. */
!   i -= remember_on_history + hist_last_line_added;
  
/* No specification defaults to most recent command. */
--- 481,490 
   so we check hist_last_line_added.  This needs to agree with the
   calculation of last_hist in fc_builtin above. */
!   /* Even though command substitution through parse_and_execute turns off
!  remember_on_history, command substitution in a shell when set -o history
!  has been enabled (interactive or not) should use it in the last_hist
!  calculation as if it were on. */
!   rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && 
enable_history_list);
!   i -= rh + hist_last_line_added;
  
/* No specification defaults to most recent command. */
*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 13
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 14
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Bash-4.0 Official Patch 13

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-013

Bug-Reported-by:jida...@jidanni.org
Bug-Reference-ID:
Bug-Reference-URL:  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165

Bug-Description:

Though references to $@ when there are no positional parameters will now
cause the shell to exit if the `errexit' option has been enabled, constructs
such as ${@:-foo} should not cause an exit.

Patch:

*** ../bash-4.0-patched/subst.c 2009-03-08 21:24:39.0 -0400
--- subst.c 2009-03-14 19:04:10.0 -0400
***
*** 86,89 
--- 86,90 
  /* Flags for the `pflags' argument to param_expand() */
  #define PF_NOCOMSUB   0x01/* Do not perform command substitution */
+ #define PF_IGNUNBOUND 0x02/* ignore unbound vars even if -u set */
  
  /* These defs make it easier to use the editor. */
***
*** 264,268 
  static int chk_arithsub __P((const char *, int));
  
! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int));
  static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, 
int *));
  static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, 
int *, int *));
--- 265,269 
  static int chk_arithsub __P((const char *, int));
  
! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int));
  static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, 
int *));
  static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, 
int *, int *));
***
*** 5196,5202 
 NAME was found inside of a double-quoted expression. */
  static WORD_DESC *
! parameter_brace_expand_word (name, var_is_special, quoted)
   char *name;
!  int var_is_special, quoted;
  {
WORD_DESC *ret;
--- 5197,5203 
 NAME was found inside of a double-quoted expression. */
  static WORD_DESC *
! parameter_brace_expand_word (name, var_is_special, quoted, pflags)
   char *name;
!  int var_is_special, quoted, pflags;
  {
WORD_DESC *ret;
***
*** 5230,5234 
  
ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL,
! (int *)NULL, (int *)NULL, 0);
free (tt);
  }
--- 5231,5235 
  
ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL,
! (int *)NULL, (int *)NULL, pflags);
free (tt);
  }
***
*** 5291,5295 
WORD_DESC *w;
  
!   w = parameter_brace_expand_word (name, var_is_special, quoted);
t = w->word;
/* Have to dequote here if necessary */
--- 5292,5296 
WORD_DESC *w;
  
!   w = parameter_brace_expand_word (name, var_is_special, quoted, 
PF_IGNUNBOUND);
t = w->word;
/* Have to dequote here if necessary */
***
*** 5308,5312 
  return (WORD_DESC *)NULL;
  
!   w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted);
free (t);
  
--- 5309,5313 
  return (WORD_DESC *)NULL;
  
!   w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0);
free (t);
  
***
*** 6659,6663 
  tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, 
quoted_dollar_atp, contains_dollar_at);
else
! tdesc = parameter_brace_expand_word (name, var_is_special, quoted);
  
if (tdesc)
--- 6660,6664 
  tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, 
quoted_dollar_atp, contains_dollar_at);
else
! tdesc = parameter_brace_expand_word (name, var_is_special, quoted, 
PF_IGNUNBOUND);
  
if (tdesc)
***
*** 6990,6994 
list = list_rest_of_args ();
  
!   if (list == 0 && unbound_vars_is_error)
{
  uerror[0] = '$';
--- 6991,6995 
list = list_rest_of_args ();
  
!   if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0)
{
  uerror[0] = '$';
***
*** 7052,7056 
list = list_rest_of_args ();
  
!   if (list == 0 && unbound_vars_is_error)
{
  uerror[0] = '$';
--- 7053,7057 
list = list_rest_of_args ();
  
!   if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0)
{
  uerror[0] = '$';


*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 12
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 13
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Bash-4.0 Official Patch 17

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-017

Bug-Reported-by:Lubomir Rintel 
Bug-Reference-ID:   <1237654931.32737.13.ca...@localhost.localdomain>
Bug-Reference-URL:  
http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00174.html

Bug-Description:

Adding a null line to a here-document (e.g., by hitting EOF) causes the
shell to dump core attempting to dereference the NULL pointer.

Patch:

*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.0 -0400
--- parse.y 2009-03-21 14:38:42.0 -0400
***
*** 1880,1884 
ret = read_a_line (remove_quoted_newline);
  #if defined (HISTORY)
!   if (remember_on_history && (parser_state & PST_HEREDOC))
  {
/* To make adding the the here-document body right, we need to rely
--- 1880,1884 
ret = read_a_line (remove_quoted_newline);
  #if defined (HISTORY)
!   if (ret && remember_on_history && (parser_state & PST_HEREDOC))
  {
/* To make adding the the here-document body right, we need to rely
*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 16
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 17
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Bash-4.0 Official Patch 16

2009-04-07 Thread Chet Ramey
 BASH PATCH REPORT
 =

Bash-Release:   4.0
Patch-ID:   bash40-016

Bug-Reported-by:Brian J. Murrell" 
Bug-Reference-ID:   <1237564627.7666.12.ca...@pc.interlinx.bc.ca>
Bug-Reference-URL:http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00160.html

Bug-Description:

There are several problems with the handling of $LINENO in an ERR trap.

Patch:

*** ../bash-4.0-patched/trap.c  2009-01-16 17:07:53.0 -0500
--- trap.c  2009-03-20 21:37:00.0 -0400
***
*** 756,760 
  
flags = SEVAL_NONINT|SEVAL_NOHIST;
!   if (sig != DEBUG_TRAP && sig != RETURN_TRAP)
flags |= SEVAL_RESETLINE;
if (function_code == 0)
--- 756,760 
  
flags = SEVAL_NONINT|SEVAL_NOHIST;
!   if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP)
flags |= SEVAL_RESETLINE;
if (function_code == 0)
*** ../bash-4.0-patched/execute_cmd.c   2009-02-13 16:41:41.0 -0500
--- execute_cmd.c   2009-03-21 14:16:11.0 -0400
***
*** 569,572 
--- 569,573 
/* Fork a subshell, turn off the subshell bit, turn off job
 control and call execute_command () on the command again. */
+   line_number_for_err_trap = line_number;
paren_pid = make_child (savestring (make_command_string (command)),
  asynchronous);
***
*** 611,615 
--- 612,619 
{
  last_command_exit_value = exec_result;
+ save_line_number = line_number;
+ line_number = line_number_for_err_trap;
  run_error_trap ();
+ line_number = save_line_number;
}
  
***
*** 767,771 
--- 771,777 
{
  last_command_exit_value = exec_result;
+ line_number = line_number_for_err_trap;
  run_error_trap ();
+ line_number = save_line_number;
}
  
***
*** 2106,2109 
--- 2112,2116 
COMMAND *tc, *second;
int ignore_return, exec_result, was_error_trap, invert;
+   volatile int save_line_number;
  
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
***
*** 2175,2178 
--- 2182,2186 
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
  
+   line_number_for_err_trap = line_number;
exec_result = execute_pipeline (command, asynchronous, pipe_in, 
pipe_out, fds_to_close);
  
***
*** 2180,2184 
--- 2188,2195 
{
  last_command_exit_value = exec_result;
+ save_line_number = line_number;
+ line_number = line_number_for_err_trap;
  run_error_trap ();
+ line_number = save_line_number;
}
  
*** ../bash-4.0/patchlevel.h2009-01-04 14:32:40.0 -0500
--- patchlevel.h2009-02-22 16:11:31.0 -0500
***
*** 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 15
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 
 looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 16
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Misleading syntax in manual

2009-04-07 Thread Reuben Thomas
The syntax for the "for" command is misleading, as although correct for 
bash, it is not POSIX-compliant.


I am using GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)

The man page says:

for name [ in word ] ; do list ; done

which conflicts with the POSIX syntax definition, given in

http://www.opengroup.org/onlinepubs/95399/utilities/xcu_chap02.html#tag_02

which says:

for name [ in [word ... ]]do
compound-list


done

Note that in the POSIX definition, a semi-colon is only needed, and indeed 
permitted, after the word list when an "in" clause is used. Hence:


for i; do

is not correct in POSIX, although it is accepted by bash. (I found this 
while trying to build GNU Zile on Solaris.) bash does, of course, accept the 
POSIX syntax.


The easiest fix seems to be to put the semicolon above in square brackets, 
making it optional, though this risks giving the impression that the syntax


for i in foo bar;; do

would be acceptable, when it's not (even by bash). So, you could give two 
explicit definitions:


for i [;] do list ; done

and

for i in word ; do list ; done

--
http://rrt.sc3d.org/
My dark path darkens; rise over the mountain, distant moon (Murasaki)
Listening to: 'Sanctus and Benedictus' from 'Mass of the Children and other
sacred music' (The Cambridge Singers / John Rutter)




Bash 4 cursor in my prompt

2009-04-07 Thread Special Sauce
From: anton
To: bug-bash@gnu.org
Subject: Cursor starts inside prompt

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -
DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -
DCONF_VENDOR='unknown' -DLOCALEDIR='/home/anton/share/locale' -
DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./
lib   -g -O2
uname output: Linux nobby-nobbs 2.6.28-9-generic #31-Ubuntu SMP Wed
Mar 11 15:43:49 UTC 2009 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.0
Patch Level: 17
Release Status: release

Description:
Starting a new instance of bash gives a prompt where the cursor
is right after my hostmane... ie right on top of my current directory.
So
if my prompt ends with "~/Desktop]$" the cursor will appear right on
top
of the "~" NOT in its regular position.

Executing a command will result in the correct prompt however
hitting enter with no command typed gives the same problem. Not
exactly
a deal-braker but very annoying on occaision.

Repeat-By:
Start bash (?) or at the prompt hit enter without typing
anything.

Fix:
Type any text then hit enter. Problem still reoccurs though (see
above)


Re: Bash 4 cursor in my prompt

2009-04-07 Thread Mike Frysinger
On Tuesday 07 April 2009 15:10:16 Special Sauce wrote:
> From: anton
> To: bug-bash@gnu.org
> Subject: Cursor starts inside prompt
>
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -
> DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -
> DCONF_VENDOR='unknown' -DLOCALEDIR='/home/anton/share/locale' -
> DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./
> lib   -g -O2
> uname output: Linux nobby-nobbs 2.6.28-9-generic #31-Ubuntu SMP Wed
> Mar 11 15:43:49 UTC 2009 x86_64 GNU/Linux
> Machine Type: x86_64-unknown-linux-gnu
>
> Bash Version: 4.0
> Patch Level: 17
> Release Status: release
>
> Description:
>   Starting a new instance of bash gives a prompt where the cursor
> is right after my hostmane... ie right on top of my current directory.
> So
> if my prompt ends with "~/Desktop]$" the cursor will appear right on
> top
> of the "~" NOT in its regular position.
>
>   Executing a command will result in the correct prompt however
> hitting enter with no command typed gives the same problem. Not
> exactly
> a deal-braker but very annoying on occaision.
>
> Repeat-By:
>   Start bash (?) or at the prompt hit enter without typing
> anything.
>
> Fix:
>   Type any text then hit enter. Problem still reoccurs though (see
> above)

considering it seems to involve the prompt, you really need to post your exact 
prompt settings (i.e. PS1/PS2/etc...)
-mike


signature.asc
Description: This is a digitally signed message part.


Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-07 Thread Mike Frysinger
On Monday 06 April 2009 22:03:28 jida...@jidanni.org wrote:
> Mike Frysinger  writes:
> > exactly do you suggest differentiating...
>
> I don't know. It's all truly over my head.
> All I know is "how are you going to 'market' this stuff in Asia?".

we dont "market" anything.  either you use it and like it, or you dont.  free 
software comes into its own rather than being pushed down your throat.  if 
something misbehaves, you suggest something better or post patches.

> I mean the US kids get to see all their -x feedback pretty, but Asians
> must see it garbled. I don't know. Some kind of set -o passthru mode, on
> by default?

a new `set -o` mode is probably sanest.  as for default, that's Chet's call of 
course, but it'd probably make more sense to have the behavior detect locale 
settings.  if you're not running in a capable unicode locale, then it shouldnt 
be on by default.  and even then, the output probably shouldnt passthru 
invalid multibyte sequences as that tends to screw up the terminal.  `set -x` 
shouldnt do that all by itself ...
-mike


signature.asc
Description: This is a digitally signed message part.


Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-07 Thread jidanni
Instead of having bash make judgements about what people want from their
personal mix of:
$ locale|sed 's/.*=//;s/"//g;/^$/d'|sort|uniq -c
  2 C
 11 zh_TW.UTF-8
instead just have a passthru option they could enable, that says "I
hereby agree that I want to be sent raw -x output back, and if it looks
weird, it's my own fault, 'garbage in, garbage out'."

In fact I forgot at the moment why they would see garbage.





Re: Bash 4 cursor in my prompt

2009-04-07 Thread Special Sauce
On Apr 8, 12:08 am, Mike Frysinger  wrote:
> On Tuesday 07 April 2009 15:10:16 Special Sauce wrote:
>
>
>
> > From: anton
> > To: bug-b...@gnu.org
> > Subject: Cursor starts inside prompt
>
> > Configuration Information [Automatically generated, do not change]:
> > Machine: x86_64
> > OS: linux-gnu
> > Compiler: gcc
> > Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -
> > DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -
> > DCONF_VENDOR='unknown' -DLOCALEDIR='/home/anton/share/locale' -
> > DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./
> > lib   -g -O2
> > uname output: Linux nobby-nobbs 2.6.28-9-generic #31-Ubuntu SMP Wed
> > Mar 11 15:43:49 UTC 2009 x86_64 GNU/Linux
> > Machine Type: x86_64-unknown-linux-gnu
>
> > Bash Version: 4.0
> > Patch Level: 17
> > Release Status: release
>
> > Description:
> >    Starting a new instance of bash gives a prompt where the cursor
> > is right after my hostmane... ie right on top of my current directory.
> > So
> > if my prompt ends with "~/Desktop]$" the cursor will appear right on
> > top
> > of the "~" NOT in its regular position.
>
> >    Executing a command will result in the correct prompt however
> > hitting enter with no command typed gives the same problem. Not
> > exactly
> > a deal-braker but very annoying on occaision.
>
> > Repeat-By:
> >    Start bash (?) or at the prompt hit enter without typing
> > anything.
>
> > Fix:
> >    Type any text then hit enter. Problem still reoccurs though (see
> > above)
>
> considering it seems to involve the prompt, you really need to post your exact
> prompt settings (i.e. PS1/PS2/etc...)
> -mike
>
>  signature.asc
> < 1KViewDownload

Sure thing

[an...@nobby-nobbs ~]$ echo $PS1
[\[\e[28;1m\...@\h\[ \e[0m\]\w]$
[an...@nobby-nobbs ~]$ echo $PS2
>

Work fine with the bash in the ubuntu repos


Re: Bash 4 cursor in my prompt

2009-04-07 Thread Ian Kelling

Mike Frysinger wrote:
considering it seems to involve the prompt, you really need to post your exact 
prompt settings (i.e. PS1/PS2/etc...)

-mike


Realize that in PS vars, \[ and \] should be used around non-printable 
characters. This surely won't happen if you start with --norc. You've got to 
track down everything in your invocation files that affects your prompt and 
narrow it down to something we can test ourselves.


- Ian Kelling





Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-07 Thread Mike Frysinger
On Wednesday 08 April 2009 02:29:17 jida...@jidanni.org wrote:
> Instead of having bash make judgements about what people want from their
> personal mix of:
> $ locale|sed 's/.*=//;s/"//g;/^$/d'|sort|uniq -c
>   2 C
>  11 zh_TW.UTF-8

locale variables have pretty clear definitions.  obviously LC_COLLATE wouldnt 
be relevant here, but LC_MESSAGES certainly would.

> instead just have a passthru option they could enable, that says "I
> hereby agree that I want to be sent raw -x output back, and if it looks
> weird, it's my own fault, 'garbage in, garbage out'."

your definition of 'garbage' is pretty loose.  you also ignore know non-
printable characters like the first ~30 characters in the ascii table.  those 
should never be printed directly.

> In fact I forgot at the moment why they would see garbage.

not every multibyte sequence is valid and thus will not map to a valid 
character.
-mike


signature.asc
Description: This is a digitally signed message part.


Re: Bash 4 cursor in my prompt

2009-04-07 Thread Ian Kelling

Special Sauce wrote:

[an...@nobby-nobbs ~]$ echo $PS1
[\[\e[28;1m\...@\h\[ \e[0m\]\w]$
[an...@nobby-nobbs ~]$ echo $PS2

Work fine with the bash in the ubuntu repos



I put this at the end of my .bashrc and it works fine for me.
PS1='[\[\e[28;1m\...@\h\[ \e[0m\]\w]$ '
Theres probably something else going on in your invocation files. Try making 
that the only line in your .bashrc and starting a non-login shell so thats the 
only file read.


- Ian Kelling




Re: Bash 4 cursor in my prompt

2009-04-07 Thread Mike Frysinger
and what `locale` settings you're using
-mike


signature.asc
Description: This is a digitally signed message part.