mainThe GNU Bourne-Again SHell - Support: sr #110943, odd behavior when running kate in...

 
 

sr #110943: odd behavior when running kate in bash script

Submitter:  ohrats <ohrats>
Submitted:  Mon 16 Oct 2023 01:59:32 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 12 Mar 2025 06:03:09 AM UTC, comment #2: 

There are several possibilities that occur to me:

0. a PS1 that includes non-printable bytes without appropriate \[ and \] so that the line displayed does not necessarily match what's in the input buffer; test this by hitting the "redraw" key to see what's really present (ctrl-L by default);
0. a custom line editor package (for example, ble, though I doubt that particular package would have such an obvious bug);
0. another process reading input from the tty (but only if job control is disabled, otherwise separated process groups will prevent this from occurring).
0. insertion of an escape sequence so that it's actually d<move-left>isown; unlikely if using readline. Inspect “history | hd” (if you don't have “hd”, use “od -c” or “hexdump”).

As a side note, if you want to disown something, you should probably disconnect stdin as well as stdout & stderr:

kate -- 'file1' file2' <>/dev/null >&0 2>&0 & disown $!


Martin D Kealey <kurahaupo>
Wed 01 Nov 2023 07:19:42 PM UTC, comment #1: 

Sorry, I can't reproduce this using bash-5.2.15. I used kubuntu 23 to attempt it.

Chet Ramey <chet>
Group administrator
Mon 16 Oct 2023 01:59:32 AM UTC, original submission:  

manjaro, GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

i'm seeing what seems to be very odd behavior when running the kate editor in a shell script - for example...

kate -- 'file1' 'file2' &> '/dev/null' & disown

this may/may not result in an error along the lines of "isown: command not found" which is interesting because 'isown' is 'disown' without the 'd', however other 'command not found' errors could be random characters from within the script (after the kate command i believe)

here's an excerpt from the script...

#!/usr/bin/env bash
set -h -u -o 'pipefail'
shopt -s 'nocasematch' 'nocaseglob'

# [...]

a=(
    ''
    'WARNING: There were issues with this file.'
    'Open the relevant files for viewing? [Y/n]'
)
printf '%s\n' "${a[@]}"
read -rsN1
if [[ "${REPLY}" != 'n' ]] ; then
    # running kate with '&> '/dev/null' & disown' sometimes results in random erroneous errors such as...
    # ./wpc.sh: line N: isown: command not found
    # see: https://invent.kde.org/utilities/kate/-/issues/113#note_780703
    kate -- 'errors.txt' "${sFile}" &> '/dev/null' & disown
    #stty 'sane'
    printf '%s\n' 'Press any key to continue...'
    read -rsN1
fi

Christoph Cullmann over at KDE says this is not an issue with kate so i'm pretty lost here

https://invent.kde.org/utilities/kate/-/issues/113

ohrats <ohrats>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kurahaupo (Posted a comment)
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by ohrats (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-11-01 chet StatusNone Works For Me

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code