diff --git a/fhem/FHEM/98_telnet.pm b/fhem/FHEM/98_telnet.pm
index eac36d928..15c585bae 100644
--- a/fhem/FHEM/98_telnet.pm
+++ b/fhem/FHEM/98_telnet.pm
@@ -20,7 +20,7 @@ telnet_Initialize($)
$hash->{UndefFn} = "telnet_Undef";
$hash->{AttrFn} = "telnet_Attr";
$hash->{NotifyFn}= "telnet_SecurityCheck";
- $hash->{AttrList} = "globalpassword password ".
+ $hash->{AttrList} = "globalpassword password prompt ".
"allowfrom SSL connectTimeout connectInterval ".
"encoding:utf8,latin1";
$hash->{ActivateInformFn} = "telnet_ActivateInform";
@@ -185,7 +185,9 @@ telnet_Read($)
my $chash = TcpServer_Accept($hash, "telnet");
return if(!$chash);
$chash->{encoding} = AttrVal($name, "encoding", "utf8");
- syswrite($chash->{CD}, sprintf("%c%c%c", 255, 253, 0) ) if( AttrVal($name, "encoding", "") ); #DO BINARY
+ $chash->{prompt} = AttrVal($name, "prompt", "fhem>");
+ syswrite($chash->{CD}, sprintf("%c%c%c", 255, 253, 0) )
+ if( AttrVal($name, "encoding", "") ); #DO BINARY
$chash->{CD}->flush();
syswrite($chash->{CD}, sprintf("%c%c%cPassword: ", 255, 251, 1)) # WILL ECHO
if(telnet_pw($name, $chash->{NAME}));
@@ -264,7 +266,7 @@ telnet_Read($)
push @ret, $ret if(defined($ret));
}
} else {
- $hash->{prompt} = 1; # Empty return
+ $hash->{showPrompt} = 1; # Empty return
if(!$hash->{motdDisplayed}) {
my $motd = $attr{global}{motd};
push @ret, $motd if($motd && $motd ne "none");
@@ -276,8 +278,8 @@ telnet_Read($)
$ret = "";
$ret .= (join("\n", @ret) . "\n") if(@ret);
- $ret .= ($hash->{prevlines} ? "> " : "fhem> ")
- if($gotCmd && $hash->{prompt} && !$hash->{rcvdQuit});
+ $ret .= ($hash->{prevlines} ? "> " : $hash->{prompt}." ")
+ if($gotCmd && $hash->{showPrompt} && !$hash->{rcvdQuit});
if($ret) {
$ret = utf8ToLatin1($ret) if( $hash->{encoding} eq "latin1" );
$ret =~ s/\n/\r\n/g if($pw); # only for DOS telnet
@@ -429,6 +431,11 @@ telnet_ActivateInform($;$)
non-local connections.
+
+