FreeBSD Bugzilla – Attachment 106345 Details for
Bug 146916
TERM not set correctly in single-user mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.90 KB, created by
guyyur
on 2010-05-24 12:50:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
guyyur
Created:
2010-05-24 12:50:01 UTC
Size:
1.90 KB
patch
obsolete
>--- histedit.c.orig 2010-05-24 02:43:10.000000000 +0300 >+++ histedit.c 2010-05-24 11:55:22.000000000 +0300 >@@ -98,6 +98,8 @@ > /* > * turn editing on > */ >+ char *term; >+ > INTOFF; > if (el_in == NULL) > el_in = fdopen(0, "r"); >@@ -107,6 +109,11 @@ > el_out = fdopen(2, "w"); > if (el_in == NULL || el_err == NULL || el_out == NULL) > goto bad; >+ term = lookupvar("TERM"); >+ if (term) >+ setenv("TERM", term, 1); >+ else >+ unsetenv("TERM"); > el = el_init(arg0, el_in, el_out, el_err); > if (el != NULL) { > if (hist) >@@ -160,6 +167,13 @@ > } > } > >+void >+setterm(const char *term) >+{ >+ if (el != NULL && term != NULL) >+ el_set(el, EL_TERMINAL, term); >+} >+ > int > histcmd(int argc, char **argv) > { >--- myhistedit.h.orig 2010-05-24 02:43:10.000000000 +0300 >+++ myhistedit.h 2010-05-24 11:55:45.000000000 +0300 >@@ -38,6 +38,7 @@ > > void histedit(void); > void sethistsize(const char *); >+void setterm(const char *); > int histcmd(int, char **); > int not_fcnumber(const char *); > int str_to_event(const char *, int); >--- var.c.orig 2010-05-24 02:43:10.000000000 +0300 >+++ var.c 2010-05-24 12:03:07.000000000 +0300 >@@ -80,6 +80,7 @@ > > #ifndef NO_HISTORY > struct var vhistsize; >+struct var vterm; > #endif > struct var vifs; > struct var vmail; >@@ -114,6 +115,10 @@ > NULL }, > { &vps4, 0, "PS4=+ ", > NULL }, >+#ifndef NO_HISTORY >+ { &vterm, VUNSET, "TERM=", >+ setterm }, >+#endif > { &voptind, 0, "OPTIND=1", > getoptsreset }, > { NULL, 0, NULL, >--- var.h.orig 2010-05-24 02:43:10.000000000 +0300 >+++ var.h 2010-05-24 11:57:07.000000000 +0300 >@@ -77,6 +77,7 @@ > extern struct var vps4; > #ifndef NO_HISTORY > extern struct var vhistsize; >+extern struct var vterm; > #endif > > /* >@@ -96,6 +97,7 @@ > #define optindval() (voptind.text + 7) > #ifndef NO_HISTORY > #define histsizeval() (vhistsize.text + 9) >+#define termval() (vterm.text + 5) > #endif > > #define mpathset() ((vmpath.flags & VUNSET) == 0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 146916
: 106345