<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>23394</bug_id>
          
          <creation_ts>2010-04-28 06:16:06 +0400</creation_ts>
          <short_desc>tune shells for term.el</short_desc>
          <delta_ts>2014-11-05 20:43:19 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Distributions</classification>
          <product>Branch 4.1</product>
          <component>emacs22-common</component>
          <version>unspecified</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          
          
          <qa_contact name="qa-4.1@altlinux.org">qa-4.1</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108900</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2010-04-28 06:16:06 +0400</bug_when>
    <thetext>emacs22-common-22.2-alt5


The commentaries in term.el.bz2 describe how shells could be tuned to work better with term. An independent package with this shell startup setup could be made: not dependent on the Emacs package, so that it could be used on remote systems accessed through Emacs.

The commentaries:

;;;  With this enhanced ansi-term.el you will get a reliable mechanism of
;;; directory/username/host tracking: the only drawback is that you will
;;; have to modify your shell start-up script.  It&apos;s worth it, believe me :).
;;;
;;; When you rlogin/su/telnet and the account you access has a modified
;;; startup script, you will be able to access the remote files as usual
;;; with C-x C-f, if it&apos;s needed you will have to enter a password,
;;; otherwise the file should get loaded straight away.
;;;
;;; This is useful even if you work only on one host: it often happens that,
;;; for maintenance reasons, you have to edit files &apos;as root&apos;: before
;;; patching term.el, I su-ed in a term.el buffer and used vi :), now I
;;; simply do a C-x C-f and, via ange-ftp, the file is automatically loaded
;;; &apos;as-root&apos;.

....


;;;  Notice: for directory/host/user tracking you need to have something
;;; like this in your shell startup script ( this is for tcsh but should
;;; be quite easy to port to other shells )
;;;
;;;             ----------------------------------------
;;;
;;;
;;;  	 set os = `uname`
;;;  	 set host = `hostname`
;;;  	 set date = `date`
;;;
;;;  # su does not change this but I&apos;d like it to
;;;
;;;  	 set user = `whoami`
;;;
;;;  # ...
;;;
;;;  	 if ( eterm =~ $TERM ) then
;;;
;;;  		echo --------------------------------------------------------------
;;;  		echo Hello $user
;;;  		echo Today is $date
;;;  		echo We are on $host running $os under Emacs term mode
;;;  		echo --------------------------------------------------------------
;;;
;;;  		setenv EDITOR emacsclient
;;;
;;;   # Notice: $host and $user have been set before to &apos;hostname&apos; and &apos;whoami&apos;
;;;   # this is necessary because, f.e., certain versions of &apos;su&apos; do not change
;;;   # $user, YMMV: if you don&apos;t want to fiddle with them define a couple
;;;   # of new variables and use these instead.
;;;   # NOTICE that there is a space between &quot;AnSiT?&quot; and $whatever NOTICE
;;;
;;;   # These are because we want the real cwd in the messages, not the login
;;;   # time one !
;;;
;;; 		set cwd_hack=&apos;$cwd&apos;
;;; 		set host_hack=&apos;$host&apos;
;;; 		set user_hack=&apos;$user&apos;
;;;
;;;   # Notice that the ^[ character is an ESC, not two chars.  You can
;;;   # get it in various ways, for example by typing
;;;   # echo -e &apos;\033&apos; &gt; escape.file
;;;   # or by using your favourite editor
;;;
;;; 		foreach temp (cd pushd)
;;; 			alias $temp &quot;$temp \!* ; echo &apos;AnSiTc&apos; $cwd_hack&quot;
;;; 		end
;;;   		alias popd &apos;popd ;echo &quot;AnSiTc&quot; $cwd&apos;
;;;
;;;   # Every command that can modify the user/host/directory should be aliased
;;;   # as follows for the tracking mechanism to work.
;;;
;;; 		foreach temp ( rlogin telnet rsh sh ksh csh tcsh zsh bash tcl su )
;;; 			alias $temp &quot;$temp \!* ; echo &apos;AnSiTh&apos; $host_hack ; \
;;; 					echo &apos;AnSiTu&apos; $user_hack ;echo &apos;AnSiTc&apos; $cwd_hack&quot;
;;; 		end
;;;
;;;   # Start up &amp; use color ls
;;;
;;; 		echo &quot;AnSiTh&quot; $host
;;; 		echo &quot;AnSiTu&quot; $user
;;; 		echo &quot;AnSiTc&quot; $cwd
;;;
;;;   # some housekeeping
;;;
;;; 		unset cwd_hack
;;; 		unset host_hack
;;; 		unset user_hack
;;; 		unset temp
;;;
;;; 		eval `/bin/dircolors /home/marco/.emacs_dircolors`
;;;    endif
;;;
;;;  # ...
;;;
;;;  # Let&apos;s not clutter user space
;;;
;;;  	 unset os
;;;  	 unset date
;;;
;;;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>148701</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2014-11-05 20:43:19 +0300</bug_when>
    <thetext>В 4.1/branch исправления не будут вноситься уже технически (заглушена очередь на сборку), поэтому прошу ошибки, актуальные для sisyphus/p7/t7, перевесить на текущие ветки или сизиф.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>