since the choice of the delete ,the delete all user data,

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
What command can I run to remove blank lines in Vim?
5,06782844
3,20782436
:g will execute a command on lines which match a regex. The regex is 'blank line' and the command is :d (delete)
41.2k1068112
Found it, it's:
3,20782436
The following can be used to remove only multi blank lines (reduce them to a single blank line) and leaving single blank lines intact:
:g/^\_$\n\_^$/d
17.3k75888
how to remove all the blanks lines
:%s,\n\n,^M,g
(do this multiple times util all the empty lines went gone)
how to remove all the blanks lines leaving SINGLE empty line
:%s,\n\n\n,^M^M,g
(do this multiple times)
how to remove all the blanks lines leaving TWO empty lines AT MAXIMUM,
:%s,\n\n\n\n,^M^M^M,g
(do this multiple times)
in order to input ^M, I have to control-Q and control-M in windows
14.8k103954
work with perl in vim:
:%!perl -pi -e s/^\s*$//g
How about:
:g/^[ \t]*$/d
This function only remove two or more blank lines, put lines below in your vimrc, then use \d to call function
fun! DelBlank()
let l = line(".")
let c = col(".")
:g/^\n\{2,}/d
call cursor(l, c)
map &special& &leader&d :keepjumps call DelBlank()&cr&
This works for me
:%s/^\s*$\n//gc
8,60532354
:g/^\s*$/d
^ begin of a line
\s* at least 0 spaces and as many as possible (greedy)
$ end of a line
:command -range=% DBL :&line1&,&line2&g/^\s*$/d
in your .vimrc,then restart your vim.
if you use command :5,12DBL
it will delete all blank lines between 5th row and 12th row.
I think my answer is the best answer!
I tried a few of the answers on this page, but a lot of them didn't work for me. Maybe because I'm using Vim on Windows 7 (don't mock, just have pity on me :p)?
Here's the easiest one that I found that works on Vim in Windows 7:
Here's a longer answer on the Vim Wikia:
This worked for me:
:%s/^[^a-zA-Z0-9]$\n//ig
It basically deletes all the lines that don't have a number or letter.
Since all the items in my list had letters, it deleted all the blank lines.
8,291132851
If something has double linespaced your text then this command will remove the double spacing and merge pre-existing repeating blank lines into a single blank line. It uses a temporary delimiter of ^^^ at the start of a line so if this clashes with your content choose something else. Lines containing only whitespace are treated as blank.
%s/^\s*\n\n\+/^^^\r/g | g/^\s*$/d | %s/^^^^.*
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Upcoming Events
Stack Overflow works best with JavaScript enabledDelete user?
I've just registered, not sure if this is the right place to ask, or if it should be a "Feature"-ticket, but anyway:
Is there a way to delete users? I have "locked" test-users, but I would like to get rid of them altogether :)
Other than that, I've done a Norwegian translation, and we use this as a test-project (get rid of misspellings, poor translation etc.) to get to know Redmine.
I will post it when we're ok with it (where to post it btw?).
I think Redmine seems - uhm - smashing :) We considered Bugzilla, and I set up Trac before I found Redmine - and I'm very happy with the finding.
Somebody should make a wikipedia-entry for it, needs some buzz, I found it by chance.
Thank you.
Deleting a user is not possible by design: what'll become the request, topic, wiki revisions made by a deleted user if it disappear? That'd mess the datas: that's why you can't delete a user.
For the translation patch, just open an issue of type "patch", indicate "translation to Norwegian against rxxxx" then just ask for t)
Thank you to get interest in redmine.
It might be possible to have an option to reassign those to other things.
The trac migration doesn't import email addresses (sets all email addresses to ), but yet we can't delete the usernames so that people can use their familiar usernames, either.
Thank you for the answer, mr. Lecavelier.
I will follow your guidance, and add it as a patch etc... but I didn't quite catch the ask for the community?
Regarding deleting an user - I understand that you've made this choice, and partly also why :)
It's not very annoying either to have those locked users around.
But it could be done.
I don't know how you do this internally, but I guess if you push deleted users to another table, keeping just the FullName and union these with real users to an User collection, but then give these an overriden no-login Login, and an IsDeleted flag or property etc...
I know nada about Ruby, that's for shure :)
Anyway, point was: no problem for me that there's no delete.
I see Redmine evolving to the even better each day now, it's fun to watch!
If the users don't register themselves but are added by you, you may also reuse a locked test user account and change its data. However this only makes sense if the test user has not added anything like tickets or wiki pages.
i have renamed my testusers to
and suvch,,,but mye girlfriend is asking why i'm answering this when i'm drunk, she says sheaes just aksing.
I understand you can't physically delete users from the database to conserve data relationships with that user, but there does need to be a flag to not display some users anywhere in the users list.
For example, what if a spam bot registers 10,000 fake users?
Sure, they are all in "registered" so that they don't show in the main filter, but if someone genuinely registered it would be a pain to go through all that.
And activating them all and then setting them to locked is no good because what if you lock people temporarily?
You'd have to go find them in the huge list to then unlock them.
There really should be a "deleted" flag along with "active" "registered" and "locked".
Just my $0.02
I Agree. I have just got my first spam user account. Any updates on this topic?
I just got my first spam as well.
I second this idea, with medium priority. Especially, one should be able of deleting an account with review of what is linked to this user (number of wiki changes etc, listed only when willing to delete an account). Reassigning all these elements, when they exist, to some "deleted user" locked account wouldn't be a so bad idea, after all, and somewhat easy to code I guess. The "deleted user" would be created when installing Redmine, and its name localizable.
My 2 cents,
How it's possible that there is no possibility to remove the users? Maybe from db?
Hi,we had the same problem in our e-learning-platform and solved it by merging wiki-entries and other stuff of a deleted users to a special "unknown"-user.
You have implement that, because every individual has the right that his/her personal data will completely deleted from a server if wanted. (German law - maybe the same elsewhere)
We have several spam accounts now and frankly it makes me very nervous that one day i might accidentally click activate on one of them instead of another legitimate account.
There are literally tens of thousands of systems that have managed to delete users and have the same challenges redmine does.
Arne makes an excellent point that some countries even require this.
Here's what I propose:
Admin "deletes" user.
User's personal info is cleared.
Username is changed to 'deleted_user_1234".
Password is cleared.
This way all system info tied to the user is intact but the user's personal info is removed.
Also, that frees up the username to be reused.
If you want to get really slick you can also set it up so that if they ever return you can rename their account to what they had it as before and they can reenter their personal info, thereby retaining their old system data.
Hi everyone,
We had to do this using the console, after realizing that our test users had to go.
The users table had delete_all relationships so we were able to do this without much effort.
On the script/console:
u = User.find(13) #change the 13 by the id of the user you want to delete
This is better than erasing the users directly on the database since some callbacks will be made.
I'm asking myself about the same thing.Splendeo Innovación: in wich console do you use your script ?Is that really working on redmine ?ThanksAurélien
@Arne: this law stands true in other countries as well.
I'm not sure why there isn't a way to update all references to user NotAnymore to user CatchAll in the DB. we do this for our web-application after users sign a data release form...
@Aurélien Leroux:
You have to make sure you have irb installed. So, i.e. in Debian/Ubuntu:
apt-get install irb
Then go to your redmine installation root directory and proceed as follows:
host:/var/webapps/redmine# export RAILS_ENV="production"
host:/var/webapps/redmine# script/console
&& u = User.find(USER_UID)
&& u.destroy
Here is a shorter version.Assuming you want to delete user ids 13 and 20, type:
$ ./script/console production
&& [13,20].each { |u| User.find(u).destroy }
I it still not possible to delete users??? Gnnggnggnnn...
What are the side-effects if I delete user from irb like described here? What will happen with the tickets / documents / wiki / forum entries attached to that user? Will everything just disappear or will it let the DB in an inconsistent state? Will these things be re-attached to another user?Or what else will happen?
This is exactly the predictable thing that happens if developers do not implement such fundamental things as "delete user and reattach issues and stuff to special user" - people are starting to find workarounds that might break other things.
But there is another aspect.
Arne is totally right - this means that redmine has to be labeled as not for use in countries with privacy laws - otherwise admins in that countries might find themselves in conflict with the law, especially if they did not know about this missing feature. We have e.g. in Germany already enough problems with so-called lawyers searching your website for potential violations of laws, which then might give them the possibility to squeeze out some money of you - this happens every day and it is legal - here is one more thing for them - if they realize the issues described here every redmine install operated by germans will be a potential victim for these rats. Fantastico!
Would be fair to inform people about this serious problem on a prominent place on the redmine.org site.
Something like this:
ATTENTION: Currently it is not possible to delete users from redmine via the web interface! If you live in a country where users have the right to have their records deleted from your databases, please DO NOT USE REDMINE!
This situation is not acceptable - an easy possibility for every user of redmine to delete users and their attached data from the database must exist!
Please discuss this and consider fixing it ASAP.
Thanks for your attention,Snaky
I have to say I disagree with the reason it would mess with data deleteing users. Surely you could just replace the deleted user with fallback users, eg the site admin.
why does it matter about the particular ID or a specific that has come and gone?
if user =- deleted {user admin or any other fallback ID of choice}?
Definitely should not delete the user entries... just the user personal info.
We track finances in our redmine system.
It's ok if the user became deleted-user-52, but they should not get completely deleted as it would completely wreck our finances.
If I classify the postings above I would say that there are two opinions to be found
Don't delete users, we need a complete history of our projects
Please let me delete old users, its bad in terms of data security and old users are filling up the database
In my opinion both positions are different use cases of Redmine. Nice what people do with this tool.
So why don't make configurable?
And if one like to delete users, give their history to the system-administrator or another functional account, if not deletion can be disabled. Let deletion be disabled as default and an update would not change the behavior of Redmine and no problem will arise for any user. This would end the discussion that is now older than 2 years and still active.
Hi Arne, I guess i'm trying to say that there's a 3rd option:
Delete user's personal info and anything that makes the system insecure, but keep the user interactions.
In general more configurations = more complexity = more bugs and harder to work with code.
I'm of the perspective that options are sort of a last resort.
I have another situation...
For one reason or the other we had Redmine manage the user base. Now Redmine has been accepted organization-wide and we are integrating with Active Directory. However, the problem is that we can't have the existing Redmine users create new accounts when they log in with their AD credentials because their emails are the same.
It would be very useful to be able to migrate profiles. Guess it would go along the requests mentioned in this thread to migrate stuff users created to "anonymous" or "deleted" user and then remove the account.
What I think of doing is change the email addresses for the currently active users and then let them create new accounts with their email addresses and Active Directory usernames.
Best regards and kudos for a great product!
Would love to have the ability to delete a user mainly for the case of spam accounts. In those cases there is very little need to worry about associated things (issues, posts, etc.) since the account would never be moved beyond that "Registered" state. (at least in my case)Kermit FAQ - The Backspace Key
[&&nbsp] &
My Backspace Key doesn't work!
Last updated:
Sat Apr 26 16:36:29 2003
The Short Answer:
Then, if necessary:
This document applies mainly to versions of Kermit that include true terminal
emulators:
for Windows
contains cautions about
application-specific key definitions, and a
tells where to put key definitions.
The Long Answer:
Terminal emulation lets you use your PC to make a connection to another
computer and interact with it as if your PC were a terminal, even though
your PC is not really a terminal and almost certainly does not have the
same kind of keyboard as the terminal it is emulating.
One of the most confusing aspects of terminal emulation is making the PC keys
do what their keytops say they do.
Many people find it quite surprising when
the Backspace key doesn't backspace, the Arrow keys don't move the cursor, the
Insert key doesn't insert, and so on.
In general only the letter and digit
keys on the main keypad can be depended upon to act as their labels suggest.
The rest, well...
each has its own story.
This is the story of the Backspace
This discussion applies mainly to PC-based versions of Kermit:
, which include full key-mapping
capabilities.
for UNIX (including
Linux, FreeBSD, AIX, Solaris, HP-UX, etc) has a limited key-mapping feature
that allows backspace/delete configuration.
However, most of the discussion
is general information that should be useful regardless of connection
method and software.
The words "left" and "right" are used in the context of left-to-right
writing systems like English, Russian, or Greek.
For right-to-left scripts
like Hebrew or Arabic, the directionality is reversed.
First some terminology.
"Backspace" might (or might not) be the name of a
For example, it is printed on the keytop of the large key at the upper
right of main keypad on the PC 101 keyboard.
On the DEC keyboard, the same
key is labeled with a symbol (<X]) instead
of a word.&
"Backspace" is also is the name of an ASCII control
character (ASCII value 8), which might or might not be associated with the
Backspace key.
"Backspace" is also an abstract concept relating to computers,
terminals, and typewriters, having at least two distinct meanings:
To erase the character left of the active position (cursor), and
simultaneously move the cursor to the position previously occupied by that
character.
This is called a destructive backspace.
To move the cursor one space to the left into the same position as the
character that was previously to its left, without erasing that character.
This is a nondestructive backspace.
Nondestructive backspacing is
usually done with the Left Arrow key, discussed
To confuse matters even further, your keyboard might have keys other than
Backspace that suggest a destructive backspace capability.
For example,
modern (101-key) PC keyboards include both a "Del" and "Delete" key and one or
two Left Arrow keys in addition to the Backspace key.
strictly for local PC functions and not, in general, for sending characters to
the host (but of course in Kermit 95 and MS-DOS Kermit you can map them to do
whatever you want).
To cause a destructive backspace operation, the terminal must send an
appropriate code to the host, and the host must reply with appropriate
terminal-specific codes to move the terminal's cursor and remove the unwanted
character.
Unfortunately, different hosts and applications use different
characters (or sequences) for destructive backspace (and of course, different
terminals use different codes for screen formatting).
The terminal emulator,
Kermit or otherwise, has no way of knowing what host or application you are
using, or how it is configured, and therefore no way of knowing what to send
when you press the Backspace key.
Of course, Kermit's Backspace key must send something &out of the
box&, i.e. in the absence of specific instructions from you.
default backspace assignment.
Each emulation (VT100, Wyse 60,
Televideo, etc) has an appropriate default assignment, namely what the
corresponding key on the real terminal sends.
Therefore, it should be sufficient to tell the host (the computer you are
connected to) what your terminal type is, and then it should expect the
destructive backspace code that is associated with that terminal.
practice, however, this is rarely enough.
example, the terminal driver has no connection with the terminal database, so
setting or changing your terminal type in Unix has no effect on the characters
it uses for destructive backspace (or other forms of editing, such as word and
line deletion).
For most emulations Kermit uses one of the two most
likely destructive backspace values, and in fact the one that is defined in
ASCII to be destructive backspace, in most cases Rubout (RUB), also known as
Delete (DEL), character number 127, which sometimes is displayed as
Lest anyone believe this is a frivolous choice, we
quote from American National Standard X3.4-1977, Section 5.1, Control
Characters:
0/8 BS (Backspace).
A one-active-position format effector that
moves the position backward on the same line.
7/15 DEL (Delete).
Also known as RUB (Rubout).
A character used
primarily to erase or obliterate an erroneous or unwanted character...
(Certain other emulations have their own defaults.
For example Data General
DASHER terminals use Control-Y for character deletion, because that is what
Data General operating systems such as AOS/VS expect.)
What happens if the wrong choice is made?
If Delete is chosen but is not the
host's destructive backspace character, it is likely to:
Interrupt or cancel the current command (default SIGINT in many Unixes).
Be accepted as a data character and echo as "^?".
Be ignored.
If Backspace is chosen but is not the host's destructive backspace character,
it is likely to:
Move the cursor to the beginning of the current line (VMS).
Perform a nondestructive backspace.
Be accepted as a data character and echo as "^H".
Enter "help mode" (EMACS).
Recall the correct part of a failing command (TOPS-20).
Even when the host terminal driver uses a specific character
such as Backspace for erasure, this does not guarantee that all applications
also use it.
One well-known case in point is EMACS, which -- in effect --
replaces the terminal in EMACS, control-characters are
used as commands: Ctrl-H for Help, Ctrl-B for (cursor) Back, Ctrl-F for
(cursor) Forward, etc.
If you find EMACS's key definitions disconcerting,
you can change them, e.g.:
(define-key global-map "\^h" 'backward-char) nondestructive
(define-key global-map "\^h" 'backward-delete-char-untabify) ; destructive
The first step in making your Backspace key behave as expected is to choose a
terminal emulation in Kermit that is appropriate for the computer you are
connecting to, and then (if necessary) tell your host what kind of terminal
Kermit is emulating.
The command for choosing a terminal emulation in Kermit
SET TERMINAL TYPE name
Type a question mark (?) in place of the name to get a list
of the available emulations.
Here are some examples:
Host Operating System
Terminal Type(s)
(Open)VMS, RT11, RSX, ...
VT100, VT102, VT220, VT320
Digital Unix, Tru64, Ultrix
VT100, VT102, VT220, VT320
DECsystem-10, DECSYSTEM-20
VT100, VT102
ANSI-BBS, AVATAR
AOS/VS or DG/UX
D210, D215, D217, D463, D470
Stratus VOS
LINUX (or VT100, VT102, VT220, VT320)
SCO XENIX, OSR5, ODT, UNIX
HPTERM, HP2621A
AIXTERM, HFT, IBM3151
SNI-97801, BA80
QNX, QANSI
Most other UNIX
VT100 or VT102
3270 protocol converters
VT100, IBM3151, Heath-19
When the most appropriate emulation is not available, most hosts also
support VT100 and/or Wyse 50 or 60.
When you make a Telnet, Rlogin, or SSH connection from Kermit to another
host, Kermit informs the other host of your terminal type automatically
with the messages appropriate to the given protocol.
Normally this is
sufficient to achieve terminal-type agreement, but will fail if the host
uses a different name for your terminal, or does not support it at all.
In that case various ruses can be used, most of which are beyond the scope
of this document.
When making network connections from Kermit to another host, you can use the
SET TELNET TERMINAL-TYPE command to override the terminal-type name sent
automatically by Kermit to the Telnet, Rlogin, or SSH server on the remote
This is handy when the your terminal is known by a different name on
A classic example occurs with SCO UNIX hosts, which use a special
SCO-specific version of "ANSI" terminal, called SCOANSI by Kermit by ANSI by
SCO, which is not the same as the ANSI terminal used elsewhere (e.g. on
BBS's), known to Kermit as ANSI.
Thus when making a connection from Kermit
to an SCO UNIX system, Kermit must be told to:
set termina The kind of terminal to emulate
set telnet terminal- The name to give to the host
When you make a serial-port or modem connection to a VMS host, as well as
to certain other hosts (notably BBS's), the host might send escape sequences
designed to provoke responses from the terminal that might indicate its type.
These probes, if they are done at all, might fail or worse (they might put
your terminal into an unusable state).
For these reasons, it is always best to configure your terminal emulator
to emulate a kind of terminal that is known to be supported on the far end
of the connection.
When none of the automatic terminal-type identification methods works,
you can still tell the host what kind of terminal you have, "manually",
by giving a command that depends on the host operating system and, in the case
of Unix, also on the shell.
Some examples (for the DEC VT100 terminal type):
set terminal /device vt100
(VMS, manual)
set terminal /inquire
(VMS, automatic)
term vt100
(Unix if it has a 'term' command)
export TERM=vt100
(Unix ksh or bash)
setenv TERM vt100
(Unix csh)
TERM=vt100 ; export TERM
TERMINAL VT100
If the host does not support the kind of terminal you have, it is often
possible to tell it the name of some other kind of terminal that is
compatible.
For example, suppose you are using C-Kermit on Linux to make
a connection to a host that never heard of "Linux" as a terminal type.
In this case you can "lie" and say you are using a VT100, because the Linux
terminal is a superset of the VT100.
Note that terminal-type names in
UNIX are case- thus the VT100 or VT-100 terminal type usually must
be given as "vt100" (lowercase) to match the entry in the host's terminal
name list.
After you have successfully informed the host of your terminal type, but the
Backspace key still does not work, you have two choices:
Change Kermit to send what the host expects.
Change the host to expect what Kermit sends.
Well, sometimes three choices.
If the Backspace key sends the DEL character
but the host wants the Backspace character, you can type Ctrl-H (hold down the
Ctrl key and press the "h" key) instead of using the Backspace key.
Kermit's SET KEY command lets you redefine the Backspace key (or any other
key) to send whatever you want it to send (or to take any other actions).
The SET KEY command has two operands: a unique identifier for a key or key
combination, called a keycode, and the value or action to be assigned
to the key, called the definition:
set key keycode definition
In Kermit commands, a keycode is a number preceded by a backslash.
are likely to be different for different operating systems, keyboards, and/or
Kermit programs.
In particular:
Keycode for Backspace Key
MS-DOS Kermit
\127 (usually!)
(You can find out the keycode of any key or key combination by giving the
SHOW KEY command.
Kermit prompt you can press any key
or key combination and Kermit tells you the keycode.)
As noted above, the characters most commonly used by terminals to send a
destructive backspace command to a host computer are single ASCII control
characters: Delete and Backspace.
Control characters are entered into SET
KEY and other Kermit commands by their numeric ASCII value, preceded by
backslash (which tells Kermit that these are character codes, rather than
literal digits).
Here are the characters used for destructive backspace, in
decreasing order of likelihood (numbers are shown in decimal):
Character Name
Alternative Name
ASCII value
Delete (DEL)
Rubout (RUB)
Backspace (BS)
Control-H (^H)
End of Medium (EM)
Control-Y (^Y)
Number Sign (#)
Pound Sign
Cancel Character (CCH)
(7-bit) ESC T
Cancel Character (CCH)
(Number sign was used on very old Unix systems that were accessed from
Teletyp this original Unix default is still found
here and there.
CCH is an 8-bit (C1) control character from ISO 6429,
which has a 7-bit coding as the sequence ESC followed by the letter T.)
Now let's put all this together to show the possible combinations:
MS-DOS Kermit
Backspace sends DEL
set key \264 \127
set key \270 \127
Backspace sends BS
key \264 \8
set key \270 \8
Backspace sends EM
set key \264 \25
set key \270 \25
Backspace sends '#'
set key \264 \35
set key \270 \35
Backspace sends CCH
set key \264 \148
set key \270 \148
Backspace sends ESC T
set key \264 \27T
set key \270 \27T
Of course other arrangements are possible too.
Remember, you can assign
any definition you want to any key or key combination.
Some people might
prefer to have Backspace always send DEL and (say) Shift-Backspace or
Control-Backspace always send Ctrl-H (or vice versa).
Example for K95:
set key \264
(Kermit 95: Backspace sends DEL)
set key \1151 \8
(Kermit 95: Ctrl-Backspace sends BS)
Where do I put these commands?
You can give SET KEY commands at the
Kermit prompt, or you can put them in your Kermit customization file:
MSCUSTOM.INI for MS-DOS K K95CUSTOM.INI for Kermit 95.
In Kermit 95, if you use the Dialer to make connections, you can also
choose the Backspace-key action for each connection on the Keyboard
page of the Dialer notebook for that connection.
In the days of real terminals, there was no way to change what a terminal's
Backspace (or equivalent) key sent.
Therefore host operating systems such
that did not require a certain kind of terminal
for access had to provide a method for adapting to different terminals.
Other host operating systems (such as VMS) always expect the same character
for destructive backspace and you can' in the VMS case, you simply
have no choice but to configure your emulator to send DEL.
Unix hosts, however, let you change your editing and interruption characters
(and much else besides) with the stty command.
particulars of this command vary greatly from one Unix variety to another, so
you'll need to view the documentation by typing one of the following commands
at the Unix shell prompt:
Here are a few examples:
Operating System
View Settings
Change to BS
Change to DEL
Digital Unix 4.0
stty erase ^h
stty erase "^?"
HP-UX 8.00
stty erase ^h
stty erase "^?"
HP-UX 10.20
stty erase ^h
stty erase ^?
stty erase ^h
stty erase ^?
stty erase ^h
stty erase ^?
stty erase "^H"
stty erase "^?"
SINIX 5.42
stty erase "^h"
stty erase "^?"
Solaris 2.5.1
stty erase ^h
stty erase ^?
stty erase ^h
stty erase ^?
Ultrix 4.3
stty erase ^h
stty erase "^?"
Unixware 7.0
stty erase ^h
stty erase ^?
Quoting requirements might vary from shell to shell (sh, ksh, bash, tcsh, etc).
When in doubt use doublequotes as shown in many of the examples above.
Note that in all cases above, the "^" character is "circumflex"
or "caret", normally produced by typing Shift-6.
In other words, "^h"
in an stty command is circumflex followed by the letter "h", not Control-H
Also note that case might be significant in the control-character
letter name: "h" or "H".
______________
Remember, "Unix" is a generic
term covering dozens of specific operating systems, such as Linux, FreeBSD,
AIX, HP-UX, Solaris, and .
As noted in the
and discussed in the
document, C-Kermit (on Unix, VMS, etc) does not have direct access to
the keyboard, and can not tell which keys have been pressed to produce the
characters that it reads from "standard input".
Therefore, there is no way
to map keys in C-Kermit.
Nevertheless, C-Kermit includes a SET KEY command similar to that of
Kermit 95 and MS-DOS Kermit, but it
maps characters, not keys.
If your terminal's Backspace key sends a single character, you can have
C-Kermit translate it to any other desired character or sequence.
what your backspace key sends, tell C-Kermit to SHOW KEY, and then press
the Backspace key:
C-Kermit& show key
Press key: (press Backspace key here)
Key code \127 =& Character \127 (self, no translation)
To make it send something else, use SET KEY.
In the following example,
we make the Backspace key send BS (ASCII 8) and then, in case we actually
need to send DEL (ASCII 127) in some situations, we assign it to Ctrl-H:
C-Kermit& set key \127 \8
C-Kermit& set key \8 \127
This sort of thing won't work with function (F) keys, arrow keys, editing
keypad keys, and the like, since (in most cases) they are seen by C-Kermit as
sequences of characters, and you can't map a sequence.
another way, the only keys you can map in C-Kermit are the ones that
correspond with ASCII characters: letters, digits, punctuation, and control
characters --
for a complete list --
or with 8-bit single-byte characters (such as A-Umlaut on a German keyboard)
if your keyboard has them.
In UNIX, you can map keys outside of Kermit in two situations:
If you are using the UNIX console (physical keyboard and screen)
directly, and your UNIX version includes a "loadkeys" command (as do, e.g.,
Linux and SCO UNIX), you can use that to assign characters or strings to
specific keys.
If you are using xterm or some other application in an X window, you
can use "xmodmap" to to assign characters or strings to specific keys.
In other situations (as when you are accessing Unix from "outside" via
Telnet, SSH, Rlogin, or modem dialup), there is no way for any software on
UNIX to know what keys you have pressed.
OK, this is an oversimplification:
in UNIX, curses-based applications might be able to recognize the
escape sequences associated with F- and arrow keys, but (a) this not reliable
since the distinction between an escape sequence generated by a key and the
same sequence entered separately is uncertain, and (b) even when these
sequences are recognized, it is only by curses-based applications, and few,
if any, of these provide for any form of mapping.
So many worries over one little key!
And we're not done yet.
Once you've
made the connection and mapped your Backspace key to work as desired when
communicating with the remote shell or whatever, you still might find that
it doesn't work right in certain applications, particularly full-screen
and/or forms-filling ones, such as EMACS (mentioned above), menus, BBS's,
or data-entry or query programs.
This can happen when the program itself
does not use the underlying terminal driver, but reads the user's keystrokes
In this case, the application might be hard-coded to use certain
characters for certain purposes, regardless of how they are used outside
the application.
If the application allows keys to be remapped (in an application-specific
manner, of course), as in the EMACS example above, and you can figure out
how to do it (for each such application you use), you'll finally have a
consistently useful Backspace key.
If not, you'll have to learn to cope
with the keyboarding requirements of each application.
There are many possibilities:
Type the appropriate SET KEY commands at the Kermit prompt as needed.
If you want a specific mapping to be in effect at all times, put the
corresponding SET KEY command(s) in your Kermit initialization or
customization file, which is executed automatically every time you start
In Kermit 95 only, you can configure the Backspace key on the Keyboard
page of the Dialer entry for each connection you have defined.
If different mappings must be used on different connections, you can
create command files or macros containing those mappings,
and then execute the appropriate one before making each connection.
To execute a command file use the TAKE command.
To execute a macro that
has already been defined (e.g. by a DEFINE command in your Kermit
customization file) use the DO command.
Alternatively, create a connection script (command file or macro) for
each host or service you connect to with Kermit, and include the appropriate
SET KEY commands in each script.
Consult the documentation for the Kermit program you are using for details.
Links to related info
... at other sites (likely to change or disappear at any time):
The Kermit FAQ / The Kermit Project / Columbia University /
/ 26 Apr 2003

我要回帖

更多关于 delete all user date 的文章

 

随机推荐