Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Newline with Enter key #4681

Closed
1 task done
ghost opened this issue Nov 28, 2020 · 15 comments
Closed
1 task done

Feature Request: Newline with Enter key #4681

ghost opened this issue Nov 28, 2020 · 15 comments

Comments

@ghost
Copy link

ghost commented Nov 28, 2020

  • I have searched open and closed issues for duplicates

Would it be possible to have the option to send the message with Ctrl+Enter and press Enter for a line break instead of sending the message with Enter?

The current behavior is Latin character-centric.
It is not suitable for Enter-heavy CJK characters.

@Maltergate
Copy link

I would also add that it prevents sending plenty of short messages as typing on a real keyboard also makes one more verbose.

Thank you

@martineizayaga
Copy link

On mac you can do Shift+Enter for a line break

@Maltergate
Copy link

On mac you can do Shift+Enter for a line break

Sure, and on Linux and Windows as well. The feature requested is to be able to set in the preferences a behaviour change so that, upon the user's preference, Enter makes a line break and Shift+Enter sends the message. Or simply (being consistent with other messaging apps) being able to disable the "Send with Enter" so that to send the message (with this option activated) one has to click on "Send" and therefore "Enter" inputs a line break.

@martineizayaga
Copy link

martineizayaga commented Dec 14, 2020

I can take this issue if that's good with everyone

@Maltergate
Copy link

Maltergate commented Dec 14, 2020

Thanks! In the meantime however I’ve discovered this behaviour (enter = line break) when one expands the text entry field with the little arrow, middle top of the field. Clicking on it the field expands and becomes several lines high, a « send » button appears, and Enter adds a line break.

https://i.imgur.com/nDDLC6d.png
https://i.imgur.com/Yvl0sEe.png

This is exactly what I was looking for. It would be nice if it was possible to make it default behaviour (an option so that when opening a conversation the app is already on several lines input by default).

@EvanHahn-Signal
Copy link
Contributor

As @Maltergate points out, you can expand the composer before sending a message. This may address your issue, but it may not because you have to change it every time.

@martineizayaga Thanks for offering to pick up the issue. Please wait until we’ve figured out exactly what we want before you start implementing—we don’t want to waste your time.

I'll follow up with our Design team in 2021 to see about adding a preference to change this.

@martineizayaga
Copy link

Ok! I just want to let you know that I've been working on it and this is what I got so far.

Screen Shot 2020-12-18 at 5 21 09 PM

Screen.Recording.2020-12-18.at.5.22.08.PM.mov

@martineizayaga
Copy link

I'm working on the newline-with-enter branch.

@direc85
Copy link

direc85 commented Aug 25, 2021

I can't find that branch anymore. Is this work dropped?

@navid-zamani
Copy link

For everyone looking for a solution out there:

Just patch it quickly, with this little shell script:

#! /bin/bash

# Signal-Desktop-Unterhaltungsentblöder: Nachrichten abschicken NUR mit Shift-Enter/Ctrl-Enter. NICHT mir nur Enter! Enter ist für Zeilenumbrüche! Damit Unterhaltungen nicht auf Twitter-Niveau beschränkt werden!


asar="/opt/Signal/resources/app.asar"
tmp="/tmp/Google Web Cancer. Kill it with fire!"
geheilt="/tmp/geheilt.asar"

[[ -e "$(which npx)" ]] || { echo "Fehler: »npx« ist nicht installiert."; exit 1; }
[[ -e "$asar.Krebsgeschwür" ]] && { echo "Anscheinend schon entblödet. Wenn dies eine neue Version ist, »sudo mv -f $asar.Krebsgeschwür $asar«, dann nochmal ausführen."; exit 2; }

npx asar extract "$asar" "$tmp"
sed -i "s/key: 13,/key: 13, shiftKey: true,/" \
    "$tmp/ts/components/CompositionInput.js" \
    "$tmp/preload.bundle.js"
npx asar pack "$tmp" "$geheilt"
rm -rf "$tmp"

sudo mv "$asar" "$asar.Krebsgeschwür"
sudo mv "$geheilt" "$asar"

It is written for Debian-likes, but of course is easily adapted to other systems.
npx from the npm package must be installed. It will automatically ask you to install asar (which is what we need) on first use.

It will make Enter create a new line, and only submit on Shift-Enter.

@navid-zamani
Copy link

I would also add that it prevents sending plenty of short messages

That’s a feature. Nobody wants to converse on the same toxic level as on Twitter (or AIM back in the days). Putting some thought into a message should be a requirement for any healthy, actually grown-up human being.

@navid-zamani
Copy link

navid-zamani commented Nov 23, 2022

I’ve discovered this behaviour (enter = line break) when one expands the text entry field with the little arrow, middle top of the field.

Nobody wants to first move his fingers off the keyboard, grab a mouse, precisely hit a teensy-tiny area, and align with the keyboard again though. 😆 Not for something that should be the default in any non-toxic UI.

@navid-zamani
Copy link

The developers just declaring bugs they failed fixing for so long they are ashamed of them as ”stale” and closing them as ”completed” is just awesome, by the way…

A true sign of competency and trustworthiness of the software.

@sarashino
Copy link

I'm working on the newline-with-enter branch.

@martineizayaga Hi!
What happened here?
I'm also CJK user as issuer do so, and I don't feel comfortable this issue that send txt by enter honestly.
Even telegram or Slack can handle this situation by configuring preferences.

If you do some jobs on this, could I have any chance to get this feature?

image

@navid-zamani
Copy link

I just updated the patch script, so it works again:

#! /bin/bash

# Signal Desktop conversation destupidifier:
#     Submit messages with Shift-Enter/Ctrl-Enter ONLY. NOT with just Enter.
#     Enter is for line breaks! So conversations aren’t limited to the level of Twitter!

# ANSI-Schnipsel
ansiInfo=$'\e[92;1m' # Hellgrün, Fett
ansiHinweis=$'\e[93;1m' # Hellgelb, Fett
ansiWarnung=$'\e[31;1m' # Dunkelrot, Fett
ansiEnde=$'\e[0m' # Zurücksetzen

# Ausgabefunktionen
info() { nachricht "$ansiInfo" "$1" "ℹ️ "; } # info <Text>
hinweis() { nachricht "$ansiHinweis" "$1" "ℹ️ "; } # hinweis <Text>
warnung() { nachricht "$ansiWarnung" "$1" "‼️ "; } # warnung <Text>
nachricht() { echo "$1${3:->>>} $2$ansiEnde"; }

# Konstanten
asar="/opt/Signal/resources/app.asar"
tmp="/tmp/Google Web Cancer. Kill it with fire!"
geheilt="/tmp/geheilt.asar"

# Versionserkennung
[[ -e "$(which npx)" ]] || { echo "Error: »npx« in not installed."; exit 1; }
if [[ -e "$asar.Krebsgeschwür" ]]; then
  info "Wurde schon ausgeführt,"
  if diff -q "$asar" "$asar.Geheilt" > /dev/null; then
    warnung "No new version. So I’ll first restore the backup of the cancerous version…"
    sudo mv -f "$asar.Krebsgeschwür" "$asar"
  else
    hinweis "New version detected. So first I’ll forget the backup of the old cancerous version…"
    sudo rm -f "$asar.Krebsgeschwür"
  fi
  hinweis "Forgetting cured version…"
  sudo rm -f "$asar.Geheilt"
fi

# Heilung
echo "Extracting…"
npx asar extract "$asar" "$tmp"
echo "Applying chemo…"
sed -ri 's/key:( *)13,/key:\113,\1ctrlKey:\1true,/g' \
    "$tmp/ts/components/CompositionInput.js" \
    "$tmp/preload.bundle.js"
echo "Re-packing…"
npx asar pack "$tmp" "$geheilt"
rm -rf "$tmp"

# Installation
echo "Backing up cancerous version…"
sudo mv "$asar" "$asar.Krebsgeschwür"
echo "Installing cured version…"
sudo mv "$geheilt" "$asar"
sudo ln -fn "$asar" "$asar.Geheilt"
hinweis "Finished."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

8 participants