Cannot enter long commands in terminal
when I type long commands cursor goes back on the same line even behind the 'bash' word.
MacBook Pro 13″, macOS 10.12
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
when I type long commands cursor goes back on the same line even behind the 'bash' word.
MacBook Pro 13″, macOS 10.12
To enter multiple lines before running any of them, use Shift+Enter or Shift+Return after typing a line. This is useful, for example, when entering a set of statements containing keywords, such as if ... end. The cursor moves down to the next line, which does not show a prompt, where you can type the next line.
http://matlab.izmiran.ru/help/techdoc/matlab_env/command9.html
Use the '\' character to support multi-line command syntax. Notice in the following example how it is used in white-space to force another line of input. Supported in Bash and Zsh shells. The $f in this instance is a WordPerfect file.
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless \
--convert-to docx:"MS Word 2007 XML" "$f" --outdir "$OUTFOLDER"
or with Ghostscript to split a PDF into a maximum of 10, sequentially numbered, 300 DPI png grayscale (DEVICE=pnggray) images:
# The intents set to zero is perceptual rendering
gs -q -dSAFER -sDEVICE=${DEVICE} -r$DPI -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
-dLastPage=$page_cnt -dTextIntent=0 -dRenderIntent=0 -dImageIntent=0 \
-dFIXEDMEDIA -dPDFFitPage -o ${BASE}_%02d.png "$1"
The operating system restricts any single command-line to a maximum of 1024 characters including the '\' character shown above.
i cannot use ... or \ break the application i am using prohibits me from using any of these delimiters
any bash parameter modification command to increase length right now it accepts only 52 characters the instance command exceeds 52 character cursor goes back to start of the line
If you are using long, complicated PS1 prompt (especially with color syntax), Bash will count all of those PS1 characters against your default line wrap count. See this Linux post for how to escape custom Bash PS1 syntax to avoid the first sentence. It should also eliminate Bash wrapping the line over itself too.
There is a very good chance your PS1 prompt string is broken.
If there are ANY characters in the PS1 prompt string that do not take up space in the prompt, then you need to bracket those characters with \[...\]
Here is my PS1
\[\$(__SetTitle ${__title}: 3)\]\D{%d%a@%R}[\[\e[44;36;1m\]BobBook_WFH\[\e[0m\]]\[\$(__vpn 1)\]\$(__vpn 2)\[\$(__vpn 3)\]\[\e[34;1m\]\$(__cwd 3)\[\e[0m\]
Yes, I know it is UGLY, but it works for me and gives a lot of information
Notice I have several places where I use \[...\] because there are escape sequences.
The \$(__SetTitle ${__title}: 3) sends the escape sequence that sets my terminal window title bar, so it takes up zero space in my command line prompt. Since the \$(...) is running a script, my terminal window title can change on each prompt, such the directory I'm in, or I'm in a source code control system view (it a work thing for me).
The \e[... are all color escape sequences.
The \$(__vpn ...) check to see if I'm VPN'ed into work or not. Again this is dynamic, so I check on each prompt.
\$(__vpn 1) outputs the RED escape sequence if I'm in a VPN session
\$(__vpn 2) outputs my visual text string (VPN) which because of the prior RED escape sequence will show up as RED, but if I'm not in a VPN, nothing comes out
\$(__vpn 3) output the turn off RED escape sequence if I'm in VPN session.
There is more, but basically the \[...\] notation is around all the terminal escape sequences that do not take up space in the command prompt.
If you forget to wrap your non-printing characters in your command prompt, you will get the behavior you are seeing.
is there a option to resize any parameters to increase the intake length ??
its way too complicated to make any sense
partially resolved problem using below command
env -i bash --norc
partially resolved using env -i bash --norc .... now atleast the cursor does not go back to start of the line
zsh uses %{...%} to wrap its non-printing characters in the command prompt.
Cannot enter long commands in terminal