Tab Completion

Hi Group
A first timer here.
I would like my QNX Terminal to use tab completion
feature like in Linux.Has anybody been able to do so?
I suspect I need readline library for that

Warm Regards
Manu
Delhi,India

You can always just install bash. If you are using QNX6 point your
pkg-installer to my repository, http://qnx.wox.org/repository/6.1/ and
install the bash 2.05a package (fresh today!).

chris


Phaedrus <badboyanand@yahoo.com> wrote:

Hi Group
A first timer here.
I would like my QNX Terminal to use tab completion
feature like in Linux.Has anybody been able to do so?
I suspect I need readline library for that

Warm Regards
Manu
Delhi,India

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I got it to work in QNX 6.1 simply by right clicking on the “terminal”
button on the photon menu bar, and doing setup. If you change the item for
terminal from “pterm” to “pterm -l” this seems to make the tab completion
work. It also fixes some problems with aliases ad exporting shell
variables.
Chris


Phaedrus <badboyanand@yahoo.com> wrote in message
news:3bfed399.3017625@News.CIS.DFN.DE

Hi Group
A first timer here.
I would like my QNX Terminal to use tab completion
feature like in Linux.Has anybody been able to do so?
I suspect I need readline library for that

Warm Regards
Manu
Delhi,India

BPC Software Group wrote:

I got it to work in QNX 6.1 simply by right clicking
on the “terminal” button on the photon menu bar,
and doing setup. If you change the item for
terminal from “pterm” to “pterm -l” this seems
to make the tab completion work.

Correct, but there’s more.

This is also detailed in the following Knowledge Base:

http://qdn.qnx.com/support/bok/solution.qnx?9825

Tab Completion (and reading of “.profile” works only if the
shell is run in “Interactive Mode” which means being started
as “ksh -l” which for a Photon Terminal requires “pterm -l”.

Changing the Shelf setting fixes that one.

You can also type “sh -l” into any Terminal window to
make it work.

Editing /etc/photon/wm/wm.menu and then copying this to
“/home/*/.ph/wm/wm.menu” fixes the launch-pterm-from-
right-mouse-click.

Then there’s the one remaining way to launch pterm,
from the Launch Menu. Good luck with that - the
configuration seems to be in the Package XML files!

Tom Evans
InitialSurnameAt
tennyson.com.au

You need to set ENV

Here’s my .profile


export ENV=$HOME/.kshrc

echo
echo ‘Get to work, you lazy bum!!!’
echo

and here’s my .kshrc


export SYSNAME=${SYSNAME:-nto}
export PROCESSOR=${PROCESSOR:-x86}
export PATH=/home/cburgess/nto/$PROCESSOR/bin:$PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

export EDITOR=vi
export VISUAL=vi

export CVSROOT=:pserver:cburgess@cvs:/usr/cvs/product
export SESSIONPATH=/tmp
export NNTPSERVER=nntp.qnx.com

export TIN_HOMEDIR=/home/cburgess/tin

case $- in
i)

export PS1=’hostname -s:/bin/pwd >’

bind ^[[z=list
bind ^I=complete

alias lf=‘ls -F’
alias l=‘ls -lF’
alias cls=“echo ‘\f’”
alias lcvs=“lynx http://cvs/

alias hex=‘printf “0x%lX\n”’
alias dec=‘printf “%ld\n”’
alias oct=‘printf “0%lo\n”’

function go {
if [ “x$1” = “x” ]; then
echo “Directories:”
for i in ~/.go-dirs/*
do
printf “%20s %s\n” basename $i cat $i
done
else
cd cat ~/.go-dirs/$1
fi
}
function save {
pwd > ~/.go-dirs/$1
}
function unsave {
rm -v ~/.go-dirs/$1
}
function nztime {
echo ‘In New Zealand, it is currently \c’
TZ=nzst-12nzdt-13,M10.1.0,M3.3.0 date “+%H:%M, %A, %B %d %Z”
}
unset mailcheck
;;
esac

Tom Evans <tom@nospam.invalid> wrote:

BPC Software Group wrote:

I got it to work in QNX 6.1 simply by right clicking
on the “terminal” button on the photon menu bar,
and doing setup. If you change the item for
terminal from “pterm” to “pterm -l” this seems
to make the tab completion work.

Correct, but there’s more.

This is also detailed in the following Knowledge Base:

http://qdn.qnx.com/support/bok/solution.qnx?9825

Tab Completion (and reading of “.profile” works only if the
shell is run in “Interactive Mode” which means being started
as “ksh -l” which for a Photon Terminal requires “pterm -l”.

Changing the Shelf setting fixes that one.

You can also type “sh -l” into any Terminal window to
make it work.

Editing /etc/photon/wm/wm.menu and then copying this to
“/home/*/.ph/wm/wm.menu” fixes the launch-pterm-from-
right-mouse-click.

Then there’s the one remaining way to launch pterm,
from the Launch Menu. Good luck with that - the
configuration seems to be in the Package XML files!

Tom Evans
InitialSurnameAt
tennyson.com.au


cburgess@qnx.com

The original question was getting Tab Completion to work.

This simply requires “ksh -l”, which, when using pterm,
requires “pterm -l”. The “-l” is totally lacking
from all of the THREE places in Photon where pterm can be
launched. I call that a bug in the Photon setup and in
the packaging setup.

Colin Burgess wrote:

You need to set ENV

Here’s my .profile

export ENV=$HOME/.kshrc

But without “pterm -l” the “.profile” doesn’t get executed
at all, so how does setting ENV in “.profile” help with
the Launch Menu configuration in the Packaging Files?

Then there’s the one remaining way to launch pterm,
from the Launch Menu. Good luck with that - the
configuration seems to be in the Package XML files!

Tom Evans
InitialSurnameAt
tennyson.com.au

…profile is defined as only being run when you login. the script pointed to by ENV is defined
as being run every time you start a new shell.

That’s why .profile should do things that you only want to do when you login, then set ENV
to point to the .kshrc script, which should do things that are required in every new shell, such
as setting aliases and key bindings.

Tom Evans <tom@nospam.invalid> wrote:

The original question was getting Tab Completion to work.

This simply requires “ksh -l”, which, when using pterm,
requires “pterm -l”. The “-l” is totally lacking
from all of the THREE places in Photon where pterm can be
launched. I call that a bug in the Photon setup and in
the packaging setup.

Colin Burgess wrote:

You need to set ENV

Here’s my .profile

export ENV=$HOME/.kshrc

But without “pterm -l” the “.profile” doesn’t get executed
at all, so how does setting ENV in “.profile” help with
the Launch Menu configuration in the Packaging Files?

It gets executed when you login to Photon. If you change
something in .profile, you need to logout of photon and then
log back in.

Then there’s the one remaining way to launch pterm,
from the Launch Menu. Good luck with that - the
configuration seems to be in the Package XML files!

Tom Evans
InitialSurnameAt
tennyson.com.au


cburgess@qnx.com

Tom Evans <tom@nospam.invalid> wrote:

The original question was getting Tab Completion to work.

This simply requires “ksh -l”, which, when using pterm,
requires “pterm -l”. The “-l” is totally lacking
from all of the THREE places in Photon where pterm can be
launched. I call that a bug in the Photon setup and in
the packaging setup.

I believe you can also put:

bind ^i=complete

in your .kshrc to make the tab completion work.

-xtang


Colin Burgess wrote:

You need to set ENV

Here’s my .profile

export ENV=$HOME/.kshrc

But without “pterm -l” the “.profile” doesn’t get executed
at all, so how does setting ENV in “.profile” help with
the Launch Menu configuration in the Packaging Files?

Then there’s the one remaining way to launch pterm,
from the Launch Menu. Good luck with that - the
configuration seems to be in the Package XML files!

Tom Evans
InitialSurnameAt
tennyson.com.au

Xiaodan Tang wrote:

Tom Evans <> tom@nospam.invalid> > wrote:
The original question was getting Tab Completion to work.

I believe you can also put:

bind ^i=complete

in your .kshrc to make the tab completion work.

Yes, but how do you get the QNX KSH to execute your .kshrc?

There’s no mention AT ALL of “.kshrc” in the ksh Help in
QNX, and I’ve tried creating a .kshrc file and can’t
persuade ksh to actually execute it (execpt by “./ ./kshrc”).

According to the Help and testing, the only files that
ksh is interested in are /etc/profile, .profile and
/etc/suid_profile.

Anyway, the point is that QNX DOESN’T WORK OUT OF THE BOX.
It shouldn’t be necessary to peruse the QNX Knowledge
Database to get stuff like this working.

Colin Burgess wrote:

.profile is defined as only being run when you login.
the script pointed to by ENV is defined
as being run every time you start a new shell.

That’s why .profile should do things that you
only want to do when you login, then set ENV
to point to the .kshrc script, which should
do things that are required in every new shell, such
as setting aliases and key bindings.

OK, so I can MANUALLYtype “ENV=.kshrc” and then every
subsequent ksh or pterm that I run executes .kshrc.

OK and since .profile runs when I first start Photon,
I should add the “ENV” setting into my .profile, and
now this is in the environment and that allows .kshrc to
run and that can set the tab completion.

It is a “solution” but it is rather tricky, nasty, possibly
“standard in Unix” (not neccesarily a good reason :slight_smile:
and if it is THE solution then QNX should set the
accounts up automatically, but…

Tell me why just fixing the Photon buttons to always run
“pterm -l” isn’t the simplest and best solution.

And, frankly, I can’t imagine any possible use for a
NON-INTERACTIVE “pterm”, so why doesn’t pterm automatically
add the “-l”, or why can’t it be configured to do this
in Pterm’s “Terminal Settings”?

Tom Evans
InitialSurnameAt
tennyson.com.au

Previously, Tom Evans wrote in comp.os.qnx:

Xiaodan Tang wrote:

Tom Evans <> tom@nospam.invalid> > wrote:
The original question was getting Tab Completion to work.

I believe you can also put:

bind ^i=complete

in your .kshrc to make the tab completion work.

Yes, but how do you get the QNX KSH to execute your .kshrc?

There’s no mention AT ALL of “.kshrc” in the ksh Help in
QNX, and I’ve tried creating a .kshrc file and can’t
persuade ksh to actually execute it (execpt by “./ ./kshrc”).

According to the Help and testing, the only files that
ksh is interested in are /etc/profile, .profile and
/etc/suid_profile.

Anyway, the point is that QNX DOESN’T WORK OUT OF THE BOX.
It shouldn’t be necessary to peruse the QNX Knowledge
Database to get stuff like this working.

Colin Burgess wrote:

.profile is defined as only being run when you login.
the script pointed to by ENV is defined
as being run every time you start a new shell.

That’s why .profile should do things that you
only want to do when you login, then set ENV
to point to the .kshrc script, which should
do things that are required in every new shell, such
as setting aliases and key bindings.

OK, so I can MANUALLYtype “ENV=.kshrc” and then every
subsequent ksh or pterm that I run executes .kshrc.

OK and since .profile runs when I first start Photon,
I should add the “ENV” setting into my .profile, and
now this is in the environment and that allows .kshrc to
run and that can set the tab completion.

It is a “solution” but it is rather tricky, nasty, possibly
“standard in Unix” (not neccesarily a good reason > :slight_smile:
and if it is THE solution then QNX should set the
accounts up automatically, but…

Tell me why just fixing the Photon buttons to always run
“pterm -l” isn’t the simplest and best solution.

And, frankly, I can’t imagine any possible use for a
NON-INTERACTIVE “pterm”, so why doesn’t pterm automatically
add the “-l”, or why can’t it be configured to do this
in Pterm’s “Terminal Settings”?

We use NON_INTERACTIVE pterms for status display screens.


Tom Evans
InitialSurnameAt
tennyson.com.au

Tom Evans <tom@nospam.invalid> wrote:

Xiaodan Tang wrote:

Tom Evans <> tom@nospam.invalid> > wrote:
The original question was getting Tab Completion to work.

I believe you can also put:

bind ^i=complete

in your .kshrc to make the tab completion work.

Yes, but how do you get the QNX KSH to execute your .kshrc?

There’s no mention AT ALL of “.kshrc” in the ksh Help in
QNX, and I’ve tried creating a .kshrc file and can’t
persuade ksh to actually execute it (execpt by “./ ./kshrc”).

According to the Help and testing, the only files that
ksh is interested in are /etc/profile, .profile and
/etc/suid_profile.

Well, I use the name “.kshrc” cause seems everybody use this
name. It could be anything as long as ENV is point to it.

In the online document:

http://qdn.qnx.com/support/docs/neutrino_2.11_en/utilities/k/ksh.html

the “Shell startup” section did talked about “ENV” parameter.

Anyway, the point is that QNX DOESN’T WORK OUT OF THE BOX.
It shouldn’t be necessary to peruse the QNX Knowledge
Database to get stuff like this working.

Well, it depends on how you define “WORK”. I use ESC-ESC to
do the completion (that is default binding, and also mentioned
in the above document), which “WORK OUT OF THE BOX” :slight_smile:

-xtang

Xiaodan Tang wrote:

Anyway, the point is that QNX DOESN’T WORK OUT OF THE BOX.
It shouldn’t be necessary to peruse the QNX Knowledge
Database to get stuff like this working.

Well, it depends on how you define “WORK”. I use ESC-ESC to
do the completion (that is default binding, and also mentioned
in the above document), which “WORK OUT OF THE BOX” > :slight_smile:

Touche.

I wasn’t expecting Esc-Meta-Alt-Ctrl-Shift (or the Spanish
Inquisition :slight_smile: so I never considered ESC-ESC.

After looking I found “^[^[” in the KSH Help, but strangely
there’s no mention of TAB-completion in there. The ONLY
difference in the key bindings between interactive and
non-interactive ksh is the addition of “^I=complete”.

I still think the three Photon launch-pterm methods
should default to Interactive.

Or, at least, information on setting ALL THREE Photon
shortcuts, and mentioning the ESC-ESC binding should be
added to the following KnowledgeBase articles:

http://qdn.qnx.com/support/bok/solution.qnx?10373
http://qdn.qnx.com/support/bok/solution.qnx?10401
http://qdn.qnx.com/support/bok/solution.qnx?10347
http://qdn.qnx.com/support/bok/solution.qnx?9825

Cheers,

Tom Evans
InitialSurnameAt
tennyson.com.au